Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Did you change the Document type, or is it the standard one used by Drupal? Which error does Firebug report? –  kiamlaluno 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
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
The filename was already slider.js. Do you mean you moved the file to another directory? –  kiamlaluno Nov 19 '12 at 19:52
add comment

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.

share|improve this answer
    
Thanks nonsenz for the hints, I found the reason finally and put it as an answer. –  corbacho May 5 '11 at 8:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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