1

I'm using the Jquery decimal mask plugin from Stefano Stypulkowski. It works fine in my project in Chrome and Firefox but it doesn't work in IE8.

I'm getting the error: Object doesn't support this property or method decimalmask.js, line 17 character 9.

I have the following scripts included:

<script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>

<script src="/Scripts/jquery.caret.1.02.min.js" type="text/javascript"></script>
<script src="/Scripts/decimalmask.js" type="text/javascript"></script>

How on earth do I go about finding out what is the problem when this works fine in FF and Chrome? Its not my code and neither am in a position to start debugging plugin code. Can anyone offer any advice how to resolve this problem? I don't really want to have my project not work in IE but in other browsers. This kind of thing drives me crazy!

jaffa
  • 26,770
  • 50
  • 178
  • 289
  • Can you debug it with Internet Explorer? Press F12, select tab called Script and click Start debugging. Maybe it gives you a hint – Tx3 Apr 27 '11 at 10:08

2 Answers2

3

This may or may not help you, but, if you load the page in IE9, you can simulate IE8 compatibility mode, then use the IE9 debugger (which isn't horrid).

HTH

Homer6
  • 15,034
  • 11
  • 61
  • 81
  • Hi, but I'm then into plugin code which I don't really want to debug. Why would it not work in IE when it works in the other browsers? – jaffa Apr 27 '11 at 10:19
  • Because IE is difficult to write bug-free javascript for, especially versions less than IE9. IE6 is harder than IE7. IE7 is harder than IE8. IE8 is harder than IE9. The plugin author probably made an error. You should submit a bug report to him (or her). – Homer6 Apr 27 '11 at 10:21
  • I've just downloaded IE9 and it works fine! Maybe a bug report is in order! – jaffa Apr 27 '11 at 10:40
  • Send it to Microsoft. I'm sure it's the first one. :-) – Homer6 Apr 27 '11 at 10:41
  • No point, they won't fix a bug in IE8 surely? Is there anyway to raise bugs against Jquery plugins? There doesn't seem to be a way of raising issues for plugins on the JQuery plugin site. – jaffa Apr 27 '11 at 10:50
  • Sorry, sarcasm doesn't translate well in text. :-) Usually the author will include their email address. Sometimes you just have to email them. – Homer6 Apr 27 '11 at 10:52
1

I resolved the problem:

Apparently anything older than IE9 doesn't support indexOf() which is used within the decimal mask plugin. IE9 does in actual fact make it easier to debug as it included the 'indexOf' in the error message rather than just 'object doesn't support this property'. Thanks to Homer6 for suggesting using IE9 in compatibility mode for IE8 with the enhanced debugger.

I had to add the following prototype to the code to support the indexOf property:

Why doesn't indexOf work on an array IE8?

Community
  • 1
  • 1
jaffa
  • 26,770
  • 50
  • 178
  • 289