Jquery, Javascript, And Ie8
OK, simple: self = $(this); Throws a JavaScript error in IE8 when it's inside an event handler. It works in every other browser. var self = $(this); Throws no error. Why?
Solution 1:
The answer is that var
keyword staring back out at you.
When you reference just plain self
, you're referencing a global variable and IE won't let you change it. When you write var self
you're declaring a local variable.
Post a Comment for "Jquery, Javascript, And Ie8"