Firebug is complaining about a error in <!DOCTYPE html>, but the HTML source is passing without problems the HTML W3C validator.

Do you have any idea? Sorry, I can't share the source code.

  • Did you change the Document type, or is it the standard one used by Drupal? Which error does Firebug report?
    – apaderno
    May 5 '11 at 8:04
  • I changed in the theme page.tpl.php to use the HTML 5 doctype, but if I put the default Drupal Doctype also is throwing the error. There is no more information from Firebug than what it's in the title of the question.
    – corbacho
    May 5 '11 at 8:14

The reason was a failed loaded javascript file.
I use the following code to add a JavaScript file:

drupal_add_js($p . '/slider.js','module','footer');

So the following HTML was added in the footer of the page:

<script type="text/javascript" src="/sites/default/modules/custom/slider/slider.js?G"></script>

At some point I renamed the file slider.js, so it stopped being loaded, and this is the reason behind the Firebug error.

In the "Net" tab, Firebug was not showing any error; it was showing just a "301 Moved Permanently" next to the slider.js file.

  • The filename was already slider.js. Do you mean you moved the file to another directory?
    – apaderno
    Nov 19 '12 at 19:52

Maybe this is your Problem, too: http://blog.rki-home.de/2008/10/22/firebug-syntax-error-und-doctype/ It's german so here what it says in short:

  • Do you have a script tag with empty src?
  • Do you link a html-file with script src anywhere?
  • Do you use some mod_rewrite rules wich could result in returning html instead of the real js-source?

When FireBug states an error, i would think it's always an JS-Error. So FB tries to parse html as js.

  • Thanks nonsenz for the hints, I found the reason finally and put it as an answer.
    – corbacho
    May 5 '11 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.