tag?", "text": "<p>I noticed today while doing some testing that the way I close my <code><script></code> tag either makes or breaks my page. For example, this works:</p>\n\n<pre class="prettyprint"><code><script src="scripts/jquery.js" type="text/javascript"></script>\n</code></pre>\n\n<p>but this does not:</p>\n\n<pre class="prettyprint"><code><script src="scripts/jquery.js" type="text/javascript" />\n</code></pre>\n\n<p>The file appears to show up when I use IE's Developer Tools, but it seems like it just gets ignored. Has anyone ever seen this or know why it might be happening? Thanks in advance!</p>", "answerCount": 3, "upvoteCount": 266, "dateCreated": "2011-05-26 21:08:18", "dateModified": "2022-10-02 07:32:18", "author": { "type": "Person", "name": "lhan" }, "acceptedAnswer": { "@type": "Answer", "text": "<p>You must include a closing script tag. The script element is not self closing, even when you're only including an external script. </p>", "upvoteCount": 144, "url": "https://exchangetuts.com/script-tag-must-include-separate-script-tag-1640627223674552#answer-1653614355611197", "dateCreated": "2022-10-01 18:32:18", "dateModified": "2022-10-02 06:32:18", "author": { "type": "Person", "name": "KatieK" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "<p>The <code><script></code> tag can only be self-closing in <em>truly</em> valid XHTML documents – that is, a XHTML page served with the <code>Content-Type</code> of <code>application/xhtml+xml</code> – <strong>and</strong> when viewed in a supporting browser (IE8 does not qualify; IE9+ does).</p>\n\n<p>In all other HTML documents, (<strong>regardless</strong> of what <code>DOCTYPE</code> is declared), the <code><script></code> tag is not self-closing and therefore <strong>must</strong> be closed with a <code></script></code>.</p>\n\n<p>Read more in this very detailed answer.</p>", "upvoteCount": 40, "url": "https://exchangetuts.com/script-tag-must-include-separate-script-tag-1640627223674552#answer-1653614360638600", "dateCreated": "2022-09-30 18:32:18", "dateModified": "2022-10-02 07:32:18", "author": { "type": "Person", "name": "josh3736" } }, { "@type": "Answer", "text": "<p>I have also noticed you always need the <code></script></code>. It's probably because it requires content between the tags ("" counts), even though you're using <code>src</code>.</p>", "upvoteCount": 30, "url": "https://exchangetuts.com/script-tag-must-include-separate-script-tag-1640627223674552#answer-1653614360643003", "dateCreated": "2022-10-01 18:32:18", "dateModified": "2022-10-02 06:32:18", "author": { "type": "Person", "name": "Andrea" } } ] } }