Hi,
I haven't tried it but this may work:
the page should load the scripts in this order:
1) jQuery 1.11.0 (the one coming with Wicket)
2) wicket-ajax-jquery.js
3) var jQuery1_11 = jQuery.noConflict();
4) jquery 1.4.4
5) your-custom-component.js
Try it
Martin Grigorov
Wicket Training and Consulting
On Tue, Mar 25, 2014 at 3:53 AM, trlt wrote:
> I wrote a simple test program to understand how jQuery.noConflict() works
> with Wicket 6. The program uses 2 different jQuery libraries (jQuery 1.11.0
> by Wicket 6 and jQuery 1.4.4 by someone else), and can be explained in its
> *.html file:
>
>
> http://wicket.apache.org";>
>
>
> Apache Wicket Quickstart
>
>
>
>
>
>
> click <#> ( ajax link )
>
>
>
>
> "decorator.js" is a program implemented by another developer. It also adds
> jQuery 1.4.4 dynamically to the page. To simplify the code, I only
> included
> the line that causes the problem:
>
> (function($) {
> $(document).ready(function() {
> $('head').prepend('');
> });
> })(jQuery);
>
>
> Problem: Wicket Ajax link (c1-link) no longer works (onClick() is never
> called). jQuery object now references version 1.4.4. In Firebug, I see the
> following error:
>
> TypeError: jQuery(...).on is not a function
> jQuery(el).on(type, data, fn); //wicket...4000.js (line 169)
>
> Question: How can I reset the jQuery object to 1.11.0 for the Wicket Ajax
> call? Can someone explain to me the execution order of the different
> jQuery
> libraries used in the program? I tried to reset it by calling
> $.noConflict() after decorator.js, but that didn't work (still points to
> 1.4.4). I'm not too sure how to unset it since it's added dynamically
> after
> the DOM object has been created.
>
> I can update the program to use jQuery 1.7+ in place of 1.4.4 to solve the
> problem, but I want to understand how 2 different libraries can be used in
> the same page. Hoping someone can help!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/jQuery-noConflict-and-wicket-6-tp4665117.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>