Lesson #1 – Debug your Web Page in Firefox. You get much better and much more debug information out of it.
The Firefox Error Console told me that the offending URL was http://www.mypage.com/scripts/blah.js and that the offending line of source code was a DOCTYPE definition, like so: !DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”
But the rest of the source file was not the blah.js file, but our Custom 404 (File Not Found) Page from the Web Server. So, looks like blah.js could not be found.
Now, I don’t have access to the live Web Server, but the Engies confirmed for me that there was no folder named ‘script’ in the IIS Directory for http://www.mypage.com, so naturally src=”/script/blah.js” did not exist. I asked them to edit the external script reference for blah.js to a Hotlink I knew was valid, like so
Tomorrow, after they do it, I’ll tell you if that fixes the problem. I’ll bet you one slightly damaged Ferrett that it works.
This Condition Is Caused By…
Update 3-Mar-2010: Firebug Rocks
I’m a little closer to solving the whole puzzle now.
Using the amazingly useful Firebug I was able to inspect the HTTP Result Codes in its Net Panel. This showed me that /scripts/blah.js got a 404 on our DEV server but a 200 (OK) on our PROD Server. That 200 is not a real 200 of course, but a Soft 404.
Checking Web.Config I found that customErrors is set to On and that it returns our custom Page “custom404.aspx” for a 404 error. The first line of that page is !DOCTYPE etc. Below is a sample customErrors entry so you know what I mean. More info from Milan Negovin here at ASP.NET Resources
customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx"
error statusCode="404" redirect="~/errors/custom404.aspx" /
Didn’t check DEV Web.Config yet. I’ll bet customErrors are off or 404.aspx does not exist on that server. Double or nothinng on the Ferretts ?
And just for fun here’s Google’s list of best 404 pages.