$(window).load And (document).ready
Solution 1:
Well, what's happening is that you're calling jQuery.noConflict()
in the first file. That method makes jQuery relinquish control of the $
variable (returns it to previous value, which, by default, is undefined
). In your second file you are using $
which, of course, is undefined by then, and that's why your code does not work.
Either remove the call to noConflict()
or wrap the code in the second file in this:
(function($) {
//...your code here ( $(window).load() and all else)
})(jQuery);
This way, the $
variable is again defined in your code, but only inside that function. However, I'd stick with the first solution. If you're using jQuery, calling .noConflict()
should be done only if you have very good reasons to use the $
variable for another purpose. Keep in mind that when people sees $
they will think about jQuery. It's almost a standard.
Post a Comment for "$(window).load And (document).ready"