Monday, December 6, 2010

Howto solve IE's Unknown Runtime Error in Javascript

OK, this type of error is really case by case, specific to IE, but in general, Internet Explorer, even though many users and developers don't really care for, is actually stricter on checking the HTML compliance, which is not necessarily a bad thing especially for javascript development. I came across this post when trying to debug this weird error: Unknown Runtime Error, when I'm trying to insert a custom dojo widget in the page. According to the post and discussions, this error could be caused by trying to manipulate innerHTML, or nested form tags, etc.. In my case, it was the nested form tags (thought I figured this out myself, but earlier comments already pointed this out). The rule of thumb is that once you see a "Unknown Runtime Error" from IE, there is something not compliant with HTML standards in your code. The practice should be, first, check your javascript code using JSlint.com to fix all the missing semicolons, or comma, that Firefox and Chrome would simply ignore, then, if the error persists, check to see if you're trying to manipulate innerHTML from within the javascript, or nested Form tags. Hope this will help!

No comments:

Post a Comment