jQuery is not defined
- by dole
Hi there,
I have to use an external js file, in which I load the jquery. My js file look like this:
document.write('<script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>');
(function($) {
$(document).ready(function() {
alert('it works!!');
});
})(jQuery);
On the firefox console I get the "jQuery is not defined" and I think it is because the jQuery library is loaded after the $ function from my js file.
Do you have any idea about how can I fix this? If I run the script from the FF console all works fine.