javascriptjqueryscript-debugging

jQuery v1.8.3 creating error in ie 8 and ie 7 "Unexpected call to method or property access."


In ie8 i am facing the problem in popup due to this line in jquery v1.8.3

this.insertBefore( elem, this.firstChild );

Here is the function

prepend: function() {
        return this.domManip(arguments, true, function( elem ) {
            if ( this.nodeType === 1 || this.nodeType === 11 ) {
                this.insertBefore( elem, this.firstChild );
            }
        }); 

here is the screenshot of error.

enter image description here

thanx in advance


Solution

  • IE8 cannot insert into html elements it doesn't recognise. It might be that there is a invalid markup, or it tries to insert a node into a HTML 5 tag.

    If it's a HTML 5 tag, you can use a script like modernizr or html5shim to create the HTML 5 tags in IE.