Wicket & jQuery Overlap / Collision

I am currently working on a web application using Wicket and have started using the jQuery (UI) core in it today. I ran into a problem that I decided to fix as a jQuery (show (), slideDown ()) function, which interferes with some of the javascript Wicket created for the external link link.

Before delving into this project, I wonder if anyone has similar experience. Are there many places where jQuery effects / actions collide with generated Wicket javascript / HTML? Are there any clean ways to avoid this or mitigate it?

I saw Wicketext as possibly the cleaner β€œintegrator” of the two, but basically it seems to be just a way to make more jQuery-ish code in Java instead of JS.

+3
source share
1 answer

This is an interesting problem since jQuery takes its own namespace. I assume that there is a conflict with the $ jQuery variable. To get around this, you can have jQuery for another namespace, for example:

var $j = jQuery.noConflict();

You can do this after you have downloaded both sets of code, and the $ value will be returned to its original value. A bit of a headache, but it can fix the situation. See using jQuery with other libraries for more information .

+3
source

Source: https://habr.com/ru/post/1711788/


All Articles