I was playing with AJAX samples by extending Javascript; I added couple of classes in a separate .JS file and included that in my aspx page.
The body section in the aspx page looked as follows:

Very simple page, right? Well, not so fast buddy; I got the following error when I ran the page.

I had no idea why this error occurred. I tried to isolate the problem by commenting/un-commenting different lines in the code, but no use and I kept getting the above error.
After trying for around two hours, I removed the <script> tag line which was including the AddClass.js file in my aspx page and re-typed that line again (I know it does not make sense but I ran out of ideas @ that time). My simple page now looked like the following:

I ran the page again and guess what, the page ran just fine and I saw the alert window.

Can you spot the difference between the two versions of the code shown above? In the original HTML, I had removed the closing </script> tag and had replaced > with /> in the script tag. <script type=”text/javascript” src=”Scripts/AddClass.js”/>
For some reason (which I don’t know yet), the browser did not like that. I re-typed that line and the Visual Studio automatically generated the end tag for me </script> and this time around the page ran fine!!!
The lesson learnt? Don’t be smarty pants all the time and let the IDE do the job for you; there was some reason that’s why Visual Studio generated the end tag as </script> instead of prefixing > with /.