• Hi there.. I’m having a problem with WordPress using Google’s hosted version of jQuery – works fine in all browsers except IE7.

    I added this code to my functions.php file:

    if( !is_admin()){
       wp_deregister_script('jquery');
       wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"), false, '1.5');
       wp_enqueue_script('jquery');
    }

    And when I load the page in IE7 it immediately chokes on the first line of the jQuery call with the error:

    “object doesn’t support this property or method”.

    If anyone has any clues, I’m kinda stumped!

    Toby

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Have you tried this plugin instead? http://wordpress.org/extend/plugins/use-google-libraries/

    Thread Starter phobic

    (@phobic)

    I’ll give it a try, thanks – I kinda figured it did the same thing.. I’ll report back.

    Thread Starter phobic

    (@phobic)

    Okay, jQuery now appears to load correctly, but I’m having problems with a number of other scripts because they use ‘$’ rather than ‘jQuery’ – I now recall this is one of the reasons I chose to manually enqueue jQuery.. is there a simple way to tell WordPress to acknowledge $ functions, or must I go through each script and switch them out?

    Many thanks for the response!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Eeeeh. Not really. You should ‘fix’ the other scripts, really.

    http://www.mkyong.com/jquery/jquery-is-not-working-in-wordpress-solution/

    Thread Starter phobic

    (@phobic)

    k, I kinda figured that was the way to go.. thanks again!

    Thread Starter phobic

    (@phobic)

    Okay.. the problem wasn’t resolved – there was just another script that loaded before it that had the same problem..

    It seems that IE7 isn’t even able to get past the first javascript call, which is the jQuery core. I have tried different versions, tried running locally, and using Google’s hosted copies, all produce the same outcome – perfectly rendered in every browser except IE7, which chokes on jQuery core – I even tried using the minified version and the uncompressed version.

    Any help greatly appreciated!

    Toby

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress, Google's jQuery and IE7’ is closed to new replies.