Re: How to use noConflict to get JQuery and Ajax (Wonder) working together?
Re: How to use noConflict to get JQuery and Ajax (Wonder) working together?
- Subject: Re: How to use noConflict to get JQuery and Ajax (Wonder) working together?
- From: Timo Hoepfner <email@hidden>
- Date: Thu, 5 Aug 2010 10:56:23 +0200
Hi David,
Am 05.08.2010 um 01:10 schrieb David BON:
I read on this link: Using jQuery with Other Libraries that I have
to insert in the <head> section the noConflict() function:
I've used a different approach mentioned on the same page once: Load
jQuery before prototype and then wrap jquery code into
jQuery(function($){...});
In the PageWrapper's head section:
<!-- load jquery -->
<wo:ERXJavaScript framework = "app" filename = "jquery/
jquery-1.4.2.min.js" />
<!-- Load prototype after jquery, this replaces the definition of
the $ function with the prototype one -->
<wo:ERXJavaScript framework = "Ajax" filename = "prototype.js" />
And then in the component:
<script type = "text/javascript">
jQuery(function($){
// $ is jQuery's $ here, not Prototype's. Do some jQuery stuff
here.
});
</script>
This will probably only work, if the third party jQuery library you
are using is built cleanly. In my case it was the date picker from
jQuery UI and it worked fine. I'd still be careful when mixing
different JS libraries though...
Timo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden