stockton Posted July 6, 2007 Share Posted July 6, 2007 Please tell me why IE6 is having an issue with the following Javascript var MyIssuedValue = document.getElementById("IssuedValue"); var MyOutstandingValue = document.getElementById("OutstandingValue"); IssuedValue = parseInt(MyIssuedValue,10); alert("IssuedValue = "+IssuedValue); IE tells me Problem with this Web page Line: 154 Char: 17 Error: Object does not support this property or method Code: 0 Now there is no line 154 in the html page so I am looking at the attached/called Javascript and line 154 is the alert("IssuedValue = "+IssuedValue); line???????? ??? Link to comment https://forums.phpfreaks.com/topic/58693-solved-ie-giving-error-whereas-firefox-does-not/ Share on other sites More sharing options...
arianhojat Posted July 6, 2007 Share Posted July 6, 2007 parseInt()'s 1st param is "The string to be parsed" My guess is when you do: var MyIssuedValue = document.getElementById("IssuedValue"); ... var IssuedValue = parseInt(MyIssuedValue,10); MyIssuedValue is the element/OBJECT, when you want the string text in it. document.getElementById("IssuedValue").value might work if its a textfield OR if its just text inside a span or div... document.getElementById("IssuedValue").innerHTML (gets the html inside of element) orrrr... document.getElementById("IssuedValue").firstChild.nodeValue (gets the textNode, then the value of it is the text itself) Ari Link to comment https://forums.phpfreaks.com/topic/58693-solved-ie-giving-error-whereas-firefox-does-not/#findComment-291174 Share on other sites More sharing options...
stockton Posted July 6, 2007 Author Share Posted July 6, 2007 Sorry but I have tried all of your suggestions all without success. Link to comment https://forums.phpfreaks.com/topic/58693-solved-ie-giving-error-whereas-firefox-does-not/#findComment-291203 Share on other sites More sharing options...
arianhojat Posted July 6, 2007 Share Posted July 6, 2007 can you post really simple html example u can post? like just the span or form field that has the number in it and an onclick on a button which runs yer code and alerts you? I can check it out with FireFox/Firebug(FF add-on) and see where problem lies better. Link to comment https://forums.phpfreaks.com/topic/58693-solved-ie-giving-error-whereas-firefox-does-not/#findComment-291214 Share on other sites More sharing options...
stockton Posted July 6, 2007 Author Share Posted July 6, 2007 Thank you for your suggestions and offer of help but the problem was that I was not defining a var. Now why Firefox accepts this and IE does not beats me. I altered IssuedValue = parseInt(MyIssuedValue,10); to var IssuedValue = parseInt(MyIssuedValue,10); & now it works. Link to comment https://forums.phpfreaks.com/topic/58693-solved-ie-giving-error-whereas-firefox-does-not/#findComment-291247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.