Support Forum
Hi. Just installed 5.0 alpha, but I'm seeing some type of JavaScript conflict/error. I have a custom tooltip popping up (one that has black background), but the browser default is popping up instead. It works on the rest of the site.
In addition, I have a JavaScript-powered drop down menu in my header that does nothing when being clicked. It works on the rest of the site.
I have the following errors in my console (repeated twice): Uncaught TypeError: Object [object Object] has no method 'tipTip'
You can access the forums here: http://itsalltech.com/forum
Any thoughts? Thanks.
You have a Google version of jquery ui that must not be enqueued as Simple Press is loading another copy and IS enqueued so doesn't know about the first.
To make things more exciting... the Google jquery ui is loaded before two copies of jquery itself. Simple Press is loading one copy and is properly enqueued so it doesn't know about the hardcoded jquery-min your theme or another plugin is loading.
Simple Press needs jquery and jquery-ui so they are enqueued. You must have the Simple Press settings to load in your footer, so that's where they appear.
But in your WordPress theme header (I assume) you have jquery and jquery-ui from the Google CDN. I'm assuming they are hardcoded in your header, or are using wp_print_scripts to output the lines.
Here's the codex link explaining wp_enqueue_script http://codex.wordpress.org/Fun.....eue_script
Generally you are asking for trouble if you use any other versions of jquery or jquery-ui then what comes with WordPress already.
I like the thought of CDN as it's less http requests to my server, and users "might" have a copy cached for faster load times. But I agree with Steve and Andy that it's risky.
Also another note, jquery-ui from CDN will have everything, or lots of things bundled together. What comes with WordPress is the core, then all the separate widgets are "separate". So other plugins that correctly (wp_enqueue_script) call for those widgets will attempt to load them separately not knowing the "bundle" is loaded and cause duplicates.
Thanks Lee - nicely explained.
This is quite possibly the number one support issue we get and also one of the most difficult to resolve as most users - to be perfectly fair - are non-technical when it comes to code. Especially when that code is not their own.
If anyone has any ideas of a good way to combat what is, in effect, a blatant disregard for the WP api, we would love to hear them...
YELLOW
SWORDFISH
|
@Andy...
maybe a Super Pain In the Butt part of the install script that uses curl or something to silently grab a copy of the forum page, or whatever page the user plans to use for SP. Do a preg_match of every possible filename combination of jquery, and jquery plugins that SP will use. And then inform the user about it if detected on install? Sounds like a nightmare [Image Can Not Be Found]
we had a previous ticket to try to do this, but never got anything working... and obviously we dont want to use a lot of resources... on install only it wouldnt be big deal, but that wouldnt help either for theme switch or new plugins added...
but we do have another ticket open in 5.0 to look at this again...
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)