I've researched around this subject for quite some time but I can't find out which method or code is causing me problems with IE7 and IE8 - it works fine in IE9, Chrome and FF. Using IE9's F12 tools to debug, the javascript stops at this line with the error object doesn't support this property or method
when running IE7 or IE8 mode:
pmt = (Math.floor((princ*intRate)/(1-Math.pow(1+开发者_如何学PythonintRate,(-1*months)))*100)/100).toFixed(2);
The script is located inline, not via a linked file.
The pmt
variable is not declared prior to this, and it seems to point to the variable as the problem. Would the script benefit from the variable being declared earlier?
Thanks in advance.
ANSWER:
As per the comment by Cory below, the problem wasn't due to any specific method, but simply my failure to add the var
declaration before the pmt
variable.
All sorted now - thanks
I dont think its a problem with math.floor or IE take a look at this fiddle: http://jsfiddle.net/4ULQL/2
May be you are passing in the wrong parameters and the expression is evaluating to something incorrect and hence the error.
精彩评论