Search code examples
javascriptnoscript

Script and Noscript tags


I have an inline script which I want to externalize but I also have noscript tags for that script. So if I externalize script, where do I put the noscript tags?


Solution

  • In the document, where you want the content to appear if the browser doesn't support JS. The location of the script isn't relevant.

    (In general, you should avoid using <noscript> in favour of Unobtrusive JavaScript / Progressive enhancement. A browser not supporting JS at all is one of the rarer reasons for JS failing).