IE 7/8 / Chrome $(window).load problem

My site is runnin fine on mac ff/safari. On pc ie 7/8 and chrome I get an error $ is not defined relating to

$(window).load(function (){}

Can anyone suggest a workaround. I chose to use window.(load) over (document).ready as I am loading in some big background images and would like them to load at the start rather than risk loading delays later.

Thanks!

Answers


  • make sure jQuery is loaded on your page

    if(typeof jQuery === 'undefined'){
        alert('no jQuery :(');
    }
    
  • make sure the $ is available and assigned correctly

    (function($){
        $(document).ready(function(){
        });
    })(jQuery);
    

Need Your Help

django apache setup troubles

python django apache2 wsgi

I'm trying to deploy my new Django website onto an Apache2 server (running on a raspberry pi). Apache is running, and able to talk my app, but it isn't working properly; it's giving me a "Template...

Log4j, get env. variable in Appender

log4j environment-variables

I am using XML log4j configuration, and in my xml i have next