Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery 1.11.1 appendChild error IE8 (Unexpected call to method or property access)

SOLVED: I was appending to SECTION tag, whereas IE8 doesn't support this tag, parsing it as text/non-closed html tag, infamous cause to halt append! so I added a condition that creates HTML5 elements for IE versions below 9, as portrayed here and the problem went away, it actually fixed a bunch of other bugs as well! http://tatiyants.com/how-to-get-ie8-to-support-html5-tags-and-web-fonts/

Sorry everyone. :(

Testing a new website I built on IE8, using jQuery v1.x (1.11.1). Using HTML5, code is validated.

I have this snippet inside a success function of an ajax function:

$('.product_details_contact_form_wrapper').detach().appendTo('#primary');

For some reason, under Chrome and Firefox it's all dandy, IE11 as well. Problem occurs when I set IE11 to emulate IE8. Then, I get a script pause and IE is complaining over appendChild in the jquery library code:

IE11(8) Inspector directs to b.appendChild(a), marked with yellow and:

"Unexpected call to method or property access." marked with red, beneath it.

enter image description here

like image 282
adi518 Avatar asked Oct 03 '14 15:10

adi518


1 Answers

Sorry for the time it took me to update this question. Ok, so the ultimate solution to this problem was adding html5shiv to my project. That's it. Ignore my previous comments.

like image 140
adi518 Avatar answered Oct 22 '22 01:10

adi518