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

    I am developing a site here:
    https://ally2.alchemycs.com

    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?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter Morgan Kay

    (@gwendydd)

    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.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    You don’t have to bump and have you considered reading the master list?

    https://www.ads-software.com/support/topic/troubleshooting-wordpress-35-master-list?replies=4

    Javascript issues can be confirmed using your browser.

    https://codex.www.ads-software.com/Using_Your_Browser_to_Diagnose_JavaScript_Errors

    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.

    Thread Starter Morgan Kay

    (@gwendydd)

    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?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    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?

    Thread Starter Morgan Kay

    (@gwendydd)

    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.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

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

    Thread Starter Morgan Kay

    (@gwendydd)

    Thread Starter Morgan Kay

    (@gwendydd)

    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.

    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, https://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.

    Thread Starter Morgan Kay

    (@gwendydd)

    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!

    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!

    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.

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

    Camaleo– Thanks for the fix.

    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

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘3.5 causing major jQuery and JavaScript errors’ is closed to new replies.