Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI and Prototype conflict
    primarykey
    data
    text
    <p>I am adding a new form to our website in Perl (wasn't my choice). There is a lot of html generate automatically for the forms to create the consistant look. My problem comes in where the legacies use prototype for various things throughout the page (including on load). However i want to use jQuery and mainly the date picker from jQuery UI. I can avoid conflicts by using jQuery.noConflict();. But i still get an error becuase of a line of code in the jQuery date picker javascript.</p> <pre><code>inst.dpDiv.zIndex($(input).zIndex()+1); </code></pre> <p>See how it still contains the $ symbol, which prototype tries to handle but can't. Does anyone have any solutions for me? I am using jQuery 1.5 and jQuery UI 1.8.6.</p> <p>In summary: I can't remove prototype.js, I would prefer to use jQuery UI datepicker and jQuery UI datepicker doesn't handle jQuery.noConflict().</p> <p>Thanks</p> <p><strong>EDIT</strong> This only happens when i try to click on the button to show the date picker. From firebug:</p> <pre><code>$(input).zIndex is not a function inst.dpDiv.zIndex($(input).zIndex()+1); datepicker.js (line 651) </code></pre> <p><strong>EDIT EDIT</strong> Updating to jQuery UI 1.8.9 doesn't change the problem.</p> <p><strong>EDIT EDIT EDIT</strong> This problem occurs when clicking the button to show the date picker. So on load the datepicker is set up fine. Changing the order of the scripts doesn't work, and any sort of variation of the following code doesn't work either.</p> <pre><code>(function($) { $(function() { // more code using $ as alias to jQuery }); })(jQuery); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload