JQuery in IE8, error: object does not support this property or method

I have jQuery for the WordPress theme I am creating. At the moment, I have refused testing IE6 and IE7 (prototyping hell), and now I am testing it using IE8. Every time I click on the prettyPhoto link or on the jQuery loop line, JS throws this error and cannot open the lightbox or move the slider. As usual, his work is beautiful in all other browsers.

The site is at http://themes.thefirm.gambit.ph

You can see the error when in IE8, and when you click the left or right arrows on the title bar.

The object does not support this property or method.

Can anybody help? Anyone else come across this? I am completely at a dead end and I cannot find anything from Google.

Update: I uploaded the site and updated this question

+4
source share
2 answers

String in jQuery (shortened version) causing the error:

somehwere on line 140: var C = Bb.exec (u)

The solution is to change this line to:

var C = Bb.exec (u.toString ())

@kirilloid is correct in that Regexp throws an error, especially when the matching value is numeric. eg. css animated properties like opacity, top, left, etc. . Converting to a string fixes the problem. Now IE is not getting any more errors.

I do not really like this fix since I edited the jQuery library file, but I think I will have to do this. This change should not have any bad side effects for normal operation.

+2
source

I just ran into the same problem. Instead of changing jQuery (yes, I understand that this is a decent patch in the short term), if necessary, contact the author of the Wordpress or Wordpress plugin / theme. They can fix the problem by using string values ​​instead of numeric values ​​when they call .animate () or other effects. For instance:

$(this).animate({opacity:0.5},500); 

Must be:

 $(this).animate({opacity:"0.5"},"500"); 

In reality, jQuery has to solve the problem in order to remain a cross browser, but in the meantime it is a solution.

+2
source

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


All Articles