Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: "Unexpected call to method or property access" in IE8 [closed]

I get that error whenever I press a certain button in my code and removing the following line makes the error go away and the button work:

$(selector_value_object).html(value_object);

And both my variables selector_value object and value_object are defined. In fact, that line only runs if both variables are defined. So what could be the cause of this error? IE8 should have support for .html(), right?

I run jQuery version 1.8.3.

Note: This problem only occurs in IE8.

like image 372
Weblurk Avatar asked Feb 12 '14 14:02

Weblurk


1 Answers

Don't know why you downvote instead of commenting. If there truly is reason for downvoting, please tell me so I learn something instead of just repeating the mistake in the future.

As for the solution: The problem was that I tried using html() on an input form field, which doesn't work in IE8. Using val() instead solved it.

like image 170
Weblurk Avatar answered Oct 21 '22 08:10

Weblurk