We've had a Javascript error on our forum pages for www.elsevier.nl for quite some time.
So, they asked me to look into it. The initial Javascript (JS) error said: line3, position 1.
But looking in the source (with IE), it show code at that position that isn't JS...
And it also didn't correspond with the source in iframes we use.
Off course, this is often the problem with JS errors in IE.
In Firefox, JS errors are much easier to track down: the JS console absolutely rules! Problem was: the error didn't show in FireFox :(
Anyway, moving on...
Testing locally, I got the following error:
So, after Googling, I was convinced there was a problem with the registration of webUIValidation.js through ASPNET_REGIIS.EXE. But after a lot of trying and testing, I still didn't get it to work...
Finally, I compared the problem with webUIValidation.js on another site, but there it worked just fine. Only difference was: our site makes use of URL rewriting with a ISAPI filter of Helicon. I decided to take a look at our rewriting rules and there I saw:
RewriteRule (.*)\/asp(.*) $1.asp$2 [I] which means: change /asp into .asp
(we use the ISAPI filter to change rewritten URL's back into standard ASP(X) URL's)
It finally hit me! Because of this rule, the path to the javascript file was also rewritten!
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"
became
src=".aspnet_client/system_web/1_1_4322/WebUIValidation.js"
What seemed to be a JavaScript error in the end turned out to be a result of URL rewriting...
AAAAhhhhh!!!!!!!!!