Title: Plugin breaking HTML output, javascript code placed before doctype!!!
Last modified: August 21, 2016

---

# Plugin breaking HTML output, javascript code placed before doctype!!!

 *  [redesigned](https://wordpress.org/support/users/redesigned/)
 * (@redesigned)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-breaking-html-output-javascript-code-placed-before-doctype/)
 * Plugin Version Version 2.74
 * This pluign in injecting the javascript before the doctype, which forces the 
   browsers into a different rendering mode and is improper html. Even though the
   line of javascript:
    `(document.getElementsByTagName('head')[0] || document.getElementsByTagName('
   body')[0]).appendChild(s);` tries to move itself, it still breaks the page, see
   wc3 validator, or view source on any browser.
 * If I strip that part from disqus.php and add it to the site footer manuall, voila,
   the page is now valid and the plugin no longer breaks the html doctype.
 * [http://wordpress.org/plugins/disqus-comment-system/](http://wordpress.org/plugins/disqus-comment-system/)

The topic ‘Plugin breaking HTML output, javascript code placed before doctype!!!’
is closed to new replies.

 * ![](https://ps.w.org/disqus-comment-system/assets/icon.svg?rev=1636350)
 * [Disqus Comment System](https://wordpress.org/plugins/disqus-comment-system/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disqus-comment-system/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disqus-comment-system/)
 * [Active Topics](https://wordpress.org/support/plugin/disqus-comment-system/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disqus-comment-system/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disqus-comment-system/reviews/)

## Tags

 * [breaks](https://wordpress.org/support/topic-tag/breaks/)
 * [doctype](https://wordpress.org/support/topic-tag/doctype/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 0 replies
 * 1 participant
 * Last reply from: [redesigned](https://wordpress.org/support/users/redesigned/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/plugin-breaking-html-output-javascript-code-placed-before-doctype/)
 * Status: not resolved