[SOLVED] JavaScript Error in IE8 - Webpage error details "Message: Invalid argument."
We were testing our newly implemented modal popup for a login functionality. It was working pretty good in Firefox, Opera, and Chrome but not in IE8. When attempts to login by clicking on a login link the login modal was not appearing in IE8. Firebug said nothing, but jquery-1.7.2.min.js in IE showed the following error:
Message: Invalid argument.
Line: 4
Char: 190
Code: 0
URI: http:// example.com/files/js/js_05f008a1c47b8161d7e4a8e6bbff1b3f_0.js
The referred line is as follows:
this.parentNode.insertBefore( a, this.nextSibling );
The surrounding script is as follows:
after:function() {
if (this[0]&&this[0].parentNode) {
return this.domManip(arguments,!1,function(a) {
this.parentNode.insertBefore(a,this.nextSibling);
});
}
if (arguments.length) {
var a=this.pushStack(this,"after",arguments);
a.push.apply(a,f.clean(arguments));
return a;
}
}
Here’s how to deal (how we dealt with) this issue:
First of all, when you identify some js error in IE be sure that it is because of violating the standards. To start off, just check for HTML errors and fix them one by one.
All you had to do in this case was:
- Perform HTML Validation using http://validator.w3.org/
Check for HTML errors. For details about the most common errors found during xhtml validation, refer this.
- Correct the listed HTML Errors one by one.
Try the same if you are facing the same issue. That should pretty much solve this one.
If that does not seem to do the job for you, just put in a comment below. We’ll try our best to help.
Zyxware is a leading Drupal development company with a team of high expertise in Drupal custom module development services since 2006.