The design template I am using needs jQuery 1.9. But Drupal 7 doesn't seem to support 1.9. Please correct me if I'm wrong The issue is that when in import jQuery 1.9 in Drupal 7 then here is the following error when in admin (overlay) trying to add content:
Uncaught TypeError: Cannot read property 'msie' of undefined
This is coming from overlay-parent.js
. It has the following code:
if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 8) {
It's causing an error because I am importing jQuery 1.9 and Drupal 7 runs code that contains the deprecated and removed jQuery.browser
method.
The problem is that, after updating the code in modules/overlay/overlay-parent.js
to:
if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/7/)) {
These changes are not taking effect. Perhaps this has to be compiled into some minimized .js
file but I am not sure. How to make these changes in Drupal 7? Any alternative ways to make jQuery 1.9 compatible Drupal 7?
navagator.userAgent
to check if its working or not. Also as David mentioned, there might be other code which are using deprecated code. To check that you can usejQuery.migrate plugin
. It will indicate in console places where deprecated code are used.