Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2012, 11:36 PM   PM User | #1
benham
New to the CF scene

 
Join Date: Jul 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
benham is an unknown quantity at this point
Jquery conflict!

Hi!

See here:
http://dev.tim-spicer.com/dev.html

PrettyPhoto was working great until I added a jquery 'slide-to-anchor' function. Now, when I visit the site in Safari, prettyPhoto stalls when loading the content.

Any ideas?

Many thanks

Ben
benham is offline   Reply With Quote
Old 07-15-2012, 10:41 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
I don’t know how often I’ve answered such issues already but if you had used the search you might have come across one of these answers because it’s always the same: Don’t include the jQuery library more than once in your site.

Your code looks like this:
Code:
<script src="/js/04/jquery-1.6.1.min.js"></script>  
<script src="/js/04/functions.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.prettyPhoto.js"></script>
You have two versions of the jQuery library there which leads to conflicts. Use the latest version and move it to the top, so that it is the first thing loaded by the browser.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 07-15-2012, 11:30 AM   PM User | #3
mimosatti
New to the CF scene

 
Join Date: Jul 2012
Location: Berlin
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mimosatti has a little shameless behaviour in the past
Several jquery libs included could be done, unfortunatelly, by external added snippets, such as widgets.

Use "jQuery" instead of "$" and invoque the jQuery.noConflict() in the begging of your jQuery code.
mimosatti is offline   Reply With Quote
Old 07-15-2012, 12:20 PM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by mimosatti View Post
Several jquery libs included could be done, unfortunatelly, by external added snippets, such as widgets.
If the widgets are coded properly then they aren’t doing this (or are checking before including, respectively), and if they aren’t coded properly they shouldn’t be used. However, the HTML in the OP’s link doesn’t look like an installed widget but like manually copied and pasted (as all similar issues I’ve answered here so far). The noConflict function should only be an exception and the very very last resort if nothing else is possible. Always try to avoid issues in the first place instead of superficially fixing them with more code.
__________________
Don’t click this link!

Last edited by VIPStephan; 07-15-2012 at 12:22 PM..
VIPStephan is offline   Reply With Quote
Old 07-15-2012, 07:29 PM   PM User | #5
benham
New to the CF scene

 
Join Date: Jul 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
benham is an unknown quantity at this point
Thanks for your tips!

I'm pretty sure it actually has nothing to do with jquery; I've isolated the problem to this line of code here:

Code:
<a href="images/fullscreen/holder.jpg" rel="prettyPhoto[pascoe-vale]" title="GAFFNEY STREET, PACOE VALE .<br><br>...
When I remove 'title=""' and its contents, prettyphoto loads just fine.

Any more thoughts?
benham is offline   Reply With Quote
Old 07-15-2012, 09:05 PM   PM User | #6
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,614
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
You can’t have HTML inside an attribute value, only text is allowed. Check your HTML and fix any possible errors.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Tags
clash, conflict, prettyphoto

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:52 AM.


Advertisement
Log in to turn off these ads.