Error: Microsoft JScript runtime error: Unable to get value of the property ”: object is null or undefined


Error: Microsoft JScript runtime error: Unable to get value of the property ”: object is null or undefined

Description: A JavaScript related error which comes from the browser scripting engine. When the JavaScript Interpreter start parsing and executing any script codes, but unable to find the document element, then this error throws up. Because the document element or object is not found or not exist on page so that the object is return as null. null is actually an object value indicating that a variable references nothing in particular. Some browsers ignore this error but some just throws it.

Example:

function window.onload()
{
  document.getElementById("txtMe").focus();
}

Solution: Avoid such errors by putting an object null reference check.

function window.onload()
{
  if (document.getElementById("txtMe") != null)
  {
    document.getElementById("txtMe").focus();
  }
}

Read: How Browser Works

Advertisements

One thought on “Error: Microsoft JScript runtime error: Unable to get value of the property ”: object is null or undefined

  1. Pingback: [RESOLVED]JavaScript Error with Details Page | Asp Forum

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s