I am working on a webpage that retrieves an external javascript file that has all my functions in it. I will name this file "functions.js".
functions.js has jQuery has $(function(){...}); to complete my operations when the page is ready. My question is, is it possible to write another $(function(){...} on the body of the same page that calls the .js functions, so that everything I do in both domReady functions happens on the page? For example, if .js functions:
$(function(){ $('div').css('color','green'); }
and I put this code in tags on the page that calls the functions. js:
$(function(){ $('div').css('background-color','red'); }
Will the page end with my divs having both green text and red backgrounds, or will one override the other or not work?
Hope this makes sense!
source share