javascript - Can you define jquery's $(function(){...}) twice on a page? -


i working on web page pulls external javascript file has of functions in it. i'll call file "functions.js".

functions.js has jquery has $(function(){...}); operations when page ready. question is, possible write $(function(){...} on body of same page calls functions.js, whatever in both of domready functions happens on page? example, if functions.js is:

$(function(){ $('div').css('color','green'); } 

and put code in tags on page calls functions.js:

$(function(){ $('div').css('background-color','red'); } 

will page end making divs have both green text , red backgrounds, or 1 override other, or neither work?

i hope makes sense!

yes, can add many $(document).ready() calls want: http://docs.jquery.com/tutorials:multiple_$(document).ready()


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -