I just solved an interesting problem.
There was a Doctype syntax error in the console.
This was caused by an invalid javascript file included on the page - invalid meaning there is no file in the src tag, or the file does not end in .js.
The fix was to remove the CMS code that was inserting an empty javascript tag with no src file.
Tricky to track down, simple to fix.
31 comments:
Thanks!!! Saved me a headache, that's for sure :)
cheers!
Thanks a lot, you saved my day...
Thank you very much it saves a lot of my time. :)
have no idea how you would find that, but that's a great tip to fix an annoying problem.
<3
In my case it was both. The wrong file extension was a typo and therefor pointing to a non-existant file.
I appreciate that. I was fighting with this issue for a long time. I read what you said and started looking at the possibility that the file was loading incorrectly and realized I had named the JS file wrong. That was a waste of 3 days. Thanks, your post helped me figure that out. Thanks again.
Thanks alot!
Saved Me DAYS of frustration. I had to include ALL of the .js files that come with script.aculo.us to avoid this error.
i've found that it's also caused by an empty js file in firefox too.
so if the file exists, but it has nothing in it, it will in some cases trigger this error.
Thank you. I spent a day trying to recognize where the problem is.
Thanks. You saved my world.
Thanks man, this one helped me out
Thanks. It saved a lot of my time.
Wow, check this. I had accidentally typed a "0" in my google analytics code and changed the domain. Since it was an invalid domain, comcast (my isp) was feeding back a 404 page from their dns server which was causing this syntax error. So, it may not even be your code doing it! Thanks for the heads up!
thanks!! error gone now
Thank you, that's saved me a lot of stress.
This happened for me when I transferred my work from my local machine to a remote server - a syntax error in the DOCTYPE of all things, and none of my javascript working. It's obvious now that I forgot to check in the javascript file to source control, but in my sleep-deprived state I could have spent hours investigating server configurations and finding out if some doctypes only work on localhost.
Thanks, saved me some time.
Brilliant, thank you! I found out that I was referencing a .js file with a hyphen instead of an underscore very quickly after reading your post.
Still helping. Thanks for your info.
Thanks! For me the error came from having ajax (jQuery) autocomplete calls to a non-existent ajax source. Your post helped me focus on the javascript instead of spacing or syntax in an html file ... lots of time saved! Thanks again.
Thanks Very Very Much! That's the exact SOLUTION !
Thanks dude! 3 years later you're still helping people!
Phoarrh. Dude! Thanks a million. This saved my evening.
Great work.Thanks alot!
Thanks Dude. There was problem with ajax request and it tells in Java Script console syntax error in line 123 Doctype. It was because of ajax response was wrong means ajax response of requested page contain js but due to html (header and tag) it was unble to execute js.
Now I have resolved my problem.
After all problem was due to JS function.
Hey thanks - helped me out just now on my project
Thanks!
thanks
Another thing that can cause the same error. Is a javascript file (.js) that is empty, nothing in it, no lines, etc..
why you might have a blank file could be for so much as a place holder for something your working on or intent on working up soon. Or for whatever reason, anyway. Quick fix for that is simply just putting a comment into the file if anything else
Awesome Catch! i am used to a Windows environment and recently started working on an Ubuntu server...capitalization counts!
Post a Comment