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 12-14-2011, 05:26 PM   PM User | #1
scootersteam
New to the CF scene

 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
scootersteam is an unknown quantity at this point
JS Conflict - HELP!

I have these two JSs that conflict on the same page, can you guys help me out? Thanks in advance!
Attached Files
File Type: txt fancybox.txt (28.1 KB, 37 views)
File Type: txt picasa-viewer.txt (3.5 KB, 48 views)
scootersteam is offline   Reply With Quote
Old 12-14-2011, 06:35 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,103
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
There are two reasons why multiple scripts in the same page will not work together.

a) duplicate variable and/or function names (including loop counters etc.)
b) multiple onload statements.
Have a look at:-
http://www.javascriptkit.com/javatut...iplejava.shtml
http://www.dyn-web.com/tutorials/combine.php

Using different Javascript frameworks often creates conflicts which are hard to to resolve.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 12-14-2011, 08:33 PM   PM User | #3
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,703
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
The problem is definitely the use of different JS frameworks. Fancybox is jQuery, picasa viewer is mootools.

Look into jQuery’s noconflict() function. If that’s all greek to you then you’re just not ready to use these tools yet and I can only recommend to either learn a little more about JavaScript and these frameworks or hire someone savvy to do the task.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 12-15-2011, 06:58 AM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
It's jQuery.noConflict()
devnull69 is offline   Reply With Quote
Reply

Bookmarks

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 11:05 PM.


Advertisement
Log in to turn off these ads.