Friday, December 2, 2011

this._form is null or not an object, JavaScript Error

While I am developing an ASP.Net application, I am getting the below JavaScript error.

this._form is null or not an object

As the error clearly states that it is a JavaScript error, I started checking all of my JavaScript code.

At last I found the root cause to resolve the issue.

When you are trying to include the JavaScript files in the page header you have to include the closing </Script> tag.

Incorrect / Causing Error:
 <script src="~/scripts/abcd.js" type="text/javascript"/>

Correct:
 <script src="~/scripts/abcd.js" type="text/javascript"></script>