Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Some type of JavaScript conflict?
Avatar
celticpride
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 5:36 pm

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. 

 
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 7:14 pm

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.

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 7:40 pm

And you have javascript that needs tiptip that comes before you pasted the entire tiptip plugin causing the tiptip error.

Avatar
celticpride
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 9:18 pm

Turns out it was a JavaScript issue with WP-Polls. Fixed it and all is well. Thanks for pointing me in the right direction. 

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 9:35 pm

Glad you got it working 🙂

But keep in mind if you have js issues later, you still have two versions of jquery and jquery-ui loaded.

Avatar
celticpride
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 9:49 pm

Huh, could you point me to the code location for that? I checked and can't seem to find anything (unless some plugin is loading it without me seeing it). 

 

Thanks  

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 3, 2011 - 10:15 pm

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.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 4, 2011 - 4:33 am

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...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 4, 2011 - 8:36 am

@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]

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 4, 2011 - 9:07 am

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...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625