This totally ambiguous error is a pretty simple fix but surprisingly, not many people have said anything about it. The error comes from Firebug. The break on this error isn’t a part of the error but it is in the firebug copy dump.
syntax error [Break on this error] <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML…3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
For instance, you won’t find this code while working with javascript, since it’s not javascript related. It’s not CSS related. It definitely has nothing to do with the server side parts of the application. What else could it be? How about ordinary html?
The way I encountered this error was that I forgot to specify a src attribute value for my script tag!
<script type="text/javascript" src=""></script>
If your script tag has a strict xhtml doc type and you forget to specify a tag’s src value, it’ll yell at you.
The solution is that you must specifiy a value for all attributes.
This is not just if your javascript src is blank. It apparently occurs any time you link to a javascript file that does not exist.
Thanx a lot man… i was trying to catch this error on a 2500 lines long form… it was crazy.
I agree! This really helped me a lot. Thanks for the post.
Thank you! This is really a dodgy error!
The cause here was, that i referenced a file via src twice in a document!
Impressive. I was just starting with a bare-boned template when this error occurred. It drove me crazy.
This error also occurs on the WebDevelopper plugin and Transitionnal DTD.
Thanks.
Thanks so much, this was driving me nuts!
Thank you so much, this really help
i never thought that empty ‘src’ was the root of this mess :)
This error appear also when your src=”” points to not existing javascript.
Thanks a lot for helping!
I thought it was a firebug bug :-)
Many thanks for this!
thank you.Favorite it.
Thank you man. I had been trying to figure out this issue for couple of months.
even if you have a valid js document that is 301 0r 302 0r 200 http status, but 0 content length, you will get this error., use firebug to check for 0 length js net requests.
Thanks, I was a bit confused, haha.
Thanks on that !!
Almost broke the screen for this error ;)
Thanks man. You are life saver! :)
Many thanks for this!
Thanks man,I get a lot from this article~~
great tip. We were able to fix a bug in our site. Thanks a lot!
Great catch. I was wondering what caused this error to pop up in Firebug seemingly in a random fashion. Thanks, Ryan.
Thx
i came across this error in another context : link to a javascript file that does not send javascript back. In this case i had to change type=”text/javascript” to type=”text/html”.
This post helped a lot, hope this helps too.
When I use your solution, the errors in firebug go away, but it does not execute the contents of the script tag.
HTML 4.01 Specification:
The script may be defined within the contents of the SCRIPT element or in an external file. If the src attribute is not set, user agents must interpret the contents of the element as the script. If the src has a URI value, user agents must ignore the element’s contents and retrieve the script via the URI.