Deprecated: Required parameter $envId follows optional parameter $userId in /web/htdocs/ on line 346
Fixing unknown runtime error in javascript - Checking In

Fixing unknown runtime error in javascript

I’ve come across it so many times, and each time I forget. So in addition to a tidbit, this is also a note to myself.

How many times has it happened that you’ve been programming, working with Firefox, Chrome or Safari and everything works fine until… you open up  your page in Internet Explorer and you see that awful “unknown runtime error” .

First thing to check if you’re using ajax and trying to set innerHtml is that there are no html syntax errors.

But it can also happen without any ajax, and 9 times out of 10 it turns out the script that’s giving the error needs a delay. You can easily find out by putting an alert() somewhere at the beginning of the script. If it then works, it means you need a delay, which you can obtain using the setTimeout() function.

Here’s a link with information on that function:

One thought on “Fixing unknown runtime error in javascript

  1. Your mode of explaining everything in this piece of writing is actually nice, Everyone can easily be aware of it, Thanks a lot. Recommended Reading: How To Lock Files The Planet Using Just Your Blog.

Comments are closed.