Invalid Argument Error In Javascript In Ie8
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Invalid Argument in IE8 up vote 2 down vote favorite this has baffled me for a couple of hours now. Why do i get a 'Invalid Argument' error when testing this in IE8? function resizeContainer() { wHeight = window.innerHeight; $('.container').each(function () { $(this).animate({ height: wHeight }, 400); }); $('.content').each(function () { wHeight = window.innerHeight; fullPad = wHeight - $(this).height(); if (wHeight < 750) { cropFactor = 1.7; } else { cropFactor = 2; } $(this).animate({ paddingTop: fullPad / cropFactor }); }); } The exact error im getting is: Invalid argument. jquery.js, line 8826 character 5 javascript jquery html invalid-argument share|improve this question edited Jun 25 '12 at 12:34 Esailija 100k8162237 asked Jun 25 '12 at 12:31 Jonas Thomsen 53210 What is the jQuery version you are using? Is this the line jQuery._data( self.elem, "fxshow" + self.prop, self.start ); ? –Esailija Jun 25 '12 at 12:35 I'm using jQuery 1.7 from here: ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js –Jonas Thomsen Jun 25 '12 at 12:36 So the line is this fx.elem.style[ fx.prop ] = fx.now + fx.unit; Where element.style["paddingTop"] is receiving invalid argument. –Esailija Jun 25 '12 at 12:37 1 try adding +'px' to paddiTop calc –charlietfl Jun 25 '12 at 12:38 I can reproduce this in IE8 with document.createElement("div").style.paddingTop = NaN; //"Invalid argument." Make sure that fullPad/cropFactor doesn't return NaN –Esailija Jun 25 '12 at 12:38 | show 3 more comments 1 Answer 1 active oldest vot
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up IE8 gives error “Invalid argument” when using prototype.js, how do I find where the error is? up vote http://stackoverflow.com/questions/11189444/invalid-argument-in-ie8 3 down vote favorite I have a fairly complex piece of Javascript that works flawlessly with no errors in Google Chrome, Firefox, Safari, and Opera. However, as tends to always be the endlessly annoying case, it completely fails in Internet Explorer. I have tested in IE7 and IE8 and get the same error: Invalid argument. prototype.js, line 2216, character 9 I am using Prototype 1.6.1 hosted through Google. The error given isn't http://stackoverflow.com/questions/4071468/ie8-gives-error-invalid-argument-when-using-prototype-js-how-do-i-find-where very helpful since it doesn't tell me where in my actual code the error is occurring. The line mentioned in the error is the 6th line from the bottom in the following code: setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, Since it is in the setStyle block of code, I assume the error occurs when I am setting style attributes for some element. However, I call setStyle over 100 times in this script and have been trying to figure out where exactly the error is occurring for several hours. Is there anything I can do to help myself in finding where the error is occurring? javascript internet-explorer prototypejs invalid-argument share|improve this question edited Dec 27 '11 at 17:46 Rob W 204k32467460 asked Nov 1 '10 at 17:36 James Simpson 4,945185692 The problem is very likely that you're trying to set a style property to some invalid value. As a side note, doing your loop that way (for ... in) is pretty dang
here for a quick overview of the site Help Center Detailed answers to any questions you http://stackoverflow.com/questions/25612971/javascript-invalid-argument-error-with-ie8 might have Meta Discuss the workings and policies of this http://www.zyxware.com/articles/2724/solved-javascript-error-in-ie8-webpage-error-details-message-invalid-argument site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community invalid argument of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JavaScript invalid argument error with IE8 up vote 0 down vote favorite IE8 is giving me an invalid argument error at character 9 of the last statement in this loop (Character 9 is the first invalid argument error letter of the icon variable.): var JOB_STATUS_ICON_DISTANCE = 125; var JOB_STATUS_ICON = {}; var center = parseInt($('#job-status-window').css('width')) / 2; var jobStatusIcons = ['A', 'B', 'C', 'D', 'E']; for (var i=0; i × Name * Email * Skype Id How can we help you * How did you come to know about us - None -Google SearchOther SearchFrom A FriendFrom A WebsiteFacebookOther Social Media What is your budget custom requirements To prevent automated spam submissions leave this field empty. You are hereHome » Articles » [SOLVED] JavaScript Error in IE8 - Webpage error details "Message: Invalid argument." [SOLVED] JavaScript Error in IE8 - Webpage error details "Message: Invalid argument." By: Deepa N Tweet August 01, 2012 - 23:35 0 Comments Javascript 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 xhtm