[closed] 3.5 causing major jQuery and JavaScript errors (17 posts)

  1. Morgan Kay
    Posted 3 years ago #

    I have a site where 3.5 is causing some really bizarre jQuery errors.

    I am developing a site here:

    On the home page, in the middle where it says "Screenings," there is a box with scrollbars. The site should be using jScrollPane to make the scrollbars match the design of the rest of the site. It worked fine before 3.5, but when I upgraded to 3.5, it broke and jScrollPane no longer works. Now I get an error message:
    Error: Permission denied to access property 'toString'
    This error message is caused by the embedded Vimeo video. If I take that out, I get a new error message:
    Error: Syntax error, unrecognized expression: [type="text/javascript"],not([type])
    That message is caused by modernizr.js, so if I disable that, I get a new error message:
    Error: Syntax error, unrecognized expression: [type="text/javascript"],not([type])
    It says that this error occurs in line 2 of jquery.min.js, which is being served by Google, so I know it doesn't have errors in it.

    In 3.4.2, this doesn't happen. In 3.5, it does. Disabling all of the plugins doesn't fix it.

    Any suggestions for what to do next?

  2. Morgan Kay
    Posted 3 years ago #

    I'm bumping this up, because I'm still totally flummoxed. Does anyone have any suggestions? Has anyone else seen anything similar? I'm thinking of submitting a bug report, because with 3.4.2, this was not a problem, and the only thing I changed on the site was the upgrade to 3.5.

  3. You don't have to bump and have you considered reading the master list?


    Javascript issues can be confirmed using your browser.


    If you do see js errors try adding

    define('SCRIPT_DEBUG', true);
    define('CONCATENATE_SCRIPTS', false );

    Which is a bit heavy handed but might fix your issue.

  4. Morgan Kay
    Posted 3 years ago #

    Thanks, Jan!

    Yes, I saw the master list, and nothing there helped.

    All of these JavaScript errors were found using Firebug.

    Adding those lines to wp-config didn't make any difference.

    Any other suggestions?

  5. Disabling all of the plugins doesn't fix it.

    How are you adding jScrollPane?

    It says that this error occurs in line 2 of jquery.min.js, which is being served by Google, so I know it doesn't have errors in it.

    Also how are you queuing up jquery? I'm guessing both are in the theme's functions.php file or are you adding that manually via header.php or footer.php?

  6. Morgan Kay
    Posted 3 years ago #

    Scripts are called using wp_enqueue_script in functions.php.

    I tried putting it in the header manually, and still got the same error messages.

  7. I think it may be your functions.php file. Using pastebin.com can you post the contents of that file?

  8. Morgan Kay
    Posted 3 years ago #

  9. Morgan Kay
    Posted 3 years ago #

    I'm really not convinced it's a functions.php problem though. I have used a very similar functions.php on a dozen or so sites, and none of them had trouble with 3.5. I tried moving all of the JavaScript to the header instead of functions.php, and still had the same problems.

  10. You need to put your wp_enqueue_script and wp_enqueue_style calls inside a function that is hooked to wp_enqueue_scripts. You are doing that for jquery but not your other ones.

    I updated your pastebin for this, http://pastebin.com/B8dnyvVa

    This may or may not fix the javascript errors which are coming from jScrollPane which may not be compatible with the latest version of jQuery 1.8.3 which you are loading because your google cdn replacement correctly checks for the current jQuery version in WordPress and pulls it down from Google.

  11. Morgan Kay
    Posted 3 years ago #

    Thanks, Chris!

    I updated my functions.php - thanks for correcting my sloppy code. But that didn't fix it, nor does an older version of jQuery.

    Let me reiterate some things I said in my very first post. The JS on the site worked. Then I updated from 3.4.2 to 3.5 and it stopped working. That's the only change I made (and I even set it up on 3.4.2 again and upgraded again to verify that this is the case).

    Secondly, the nature of the error messages I am getting is very strange. The errors say that there are problems in jquery.min.js, which is really bizarre when it's coming from Google.

    I'm not saying that I don't think I'm not the source of the problem, or that I haven't done something dumb in my code, but I have pretty extensively tested various iterations and configurations of my JavaScript code, and I think there's something bigger going on here.

    Thanks again, Chris and Jan, for all your help!

  12. camaleo
    Posted 3 years ago #

    Hi Morgan,

    I faced the same issue and fixed it by adding:
    define('CONCATENATE_SCRIPTS', false);

    in the wp-config.php file, right before this line:
    require_once( ABSPATH .'wp-settings.php' );

    Hope it helps!

  13. Native Imaging
    Posted 3 years ago #

    define('CONCATENATE_SCRIPTS', false);
    Seemed to fix the problem i was having. Is this a permanent fix?

    Thank you by the way. was completely stumped today on this issue.

  14. camaleo
    Posted 3 years ago #

    Once version 3.5.1 will become available I will try to remove the line and see if they fixed the issue.

  15. Storyman
    Posted 3 years ago #

    Camaleo-- Thanks for the fix.

  16. opticalfuel
    Posted 2 years ago #

    Ver 3.5.x is not been a good version so far... The jQuery and JavaScript bugs are pretty significant. I think someone needs to reverse course on the 3.5 dev back to 3.4.2 and start again. It's just not working out.

    I had a suspicion that the issues I was having was mainly the version since my client had installed 3.5.1 already... I downgraded to 3.4.2 and magically all the weird (an annoying) jQuery issues vanished.

    At least we know what to do now.

    Hang tough, wait for 3.6.x

  17. Andrew
    Forum moderator
    Posted 2 years ago #

    Sorry to tell you this but WordPress 3.5 does not have the jQuery conflict, it is plugins and themes or persons who hack them.

    As the above comment doesn't contribute to this old thread, I'm going to close it.

Topic Closed

This topic has been closed to new replies.

About this Topic