Jun 06

‘null’ is null or not an object

Tag: Programming & InternetDustin @ 9:14 am

After writing my fuel trip calculator, I learned there was a bug in IE. I got it to work but I get getting ‘meters’ is null or not an object or even worse, ‘null’ is null or not an object. I tried everything I could think of in the javascript code to get rid of that message in IE.

I realized that the function was being called twice for some reason, and that is where I finally found the culprit. The error wasn’t in the javascript, it was in the html.

When I first wrote the tool, I just called the javascript function using a button and onclick method. Then I changed it to a form so you could just hit enter in any field. But, I forgot to take out the onclick method from the submit button. So therein lied the problem. Once I removed that the error went away.

Leave a Reply

This site uses KeywordLuv. Enter YourName@YourKeywords in the Name field to take advantage.



ss_blog_claim=4973c51f5e7bec57951f995fed1b85f3 ss_blog_claim=4973c51f5e7bec57951f995fed1b85f3