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 09-22-2010, 03:21 PM   PM User | #1
daemonkin
Regular Coder

 
Join Date: Jun 2007
Location: N. Ireland
Posts: 351
Thanks: 16
Thanked 4 Times in 4 Posts
daemonkin is on a distinguished road
jQuery and Ajax Conflict

Hi guys,

Using jQuery Tabs to display some data but I also have an AjaxExpansion (WebObjects/WOnder feature) on the page. WOnder is smart and only includes the following on the page if Ajax is used:

Code:
<script type="text/javascript" src="/cgi-bin/WebObjects/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/prototype.js"></script>
<script type="text/javascript" src="/cgi-bin/WebObjects/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/effects.js"></script>
<script type="text/javascript" src="/cgi-bin/.../WonderLatest/Frameworks/Ajax/Ajax/build/Ajax.framework/WebServerResources/wonder.js"></script>
The above scripts are written to the page at the very end of the head section.

On the page I have the following:

Code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
 $(document).ready(function() {
    $("#tabs").tabs();
  });
</script>
	
<div id="tabs">
  <ul>
    <li><a href="#section-1" title="">Latest press</a></li>
    <li><a href="#section-2" title="">Latest PR</a></li>
</ul>
<div id="section-1">Section 1</div>
<div id="section-2">Section 2</div>
When done this way the Ajax is broken but the jQuery tabbing works.

When I move the jQuery scripts into the head, the Ajax scripts which are written after the jQuery take precedence and the Ajax works but the jQuery tabs is broken.

I have been scratching my head and need help. Any help appreciated.

D.
__________________
Daemonkin.
If this was helpful, please add to my reputation
Thousand Sons - Freelance Web Developer - ninetyonedegrees.com
daemonkin is offline   Reply With Quote
Old 09-22-2010, 05:05 PM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
I'm not familiar with Wonder, but it's including the Prototype JS library on your page.

Use jQuery noConflict() to make them play nice together.
Spudhead 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 10:48 AM.


Advertisement
Log in to turn off these ads.