[theme-reviewers] Embedding inline JavaScript in <head>?

Otto otto at ottodestruct.com
Tue Oct 16 17:07:30 UTC 2012

I personally have no problem with one-line scripts like this in a
theme template. The wp-admin does it this way itself, although it adds
this script in after the opening <body> tag:

<script type="text/javascript">
	document.body.className = document.body.className.replace('no-js','js');


On Tue, Oct 16, 2012 at 12:02 PM, WPForever Team <hi at wpforever.com> wrote:
> This is my first post here, I hope I'm doing it correctly.
> I want to add a "no-js" class to <html>, and then remove it immediately (and
> add "js") if the browser supports JavaScript. For this, I want to add the
> following as the first thing after <head>
>     <script>(function(h){h.className = h.className.replace('no-js',
> 'js')})(document.documentElement)</script>
> >From what I could understand from the Theme Review page in the Codex, this
> isn't allowed.
> Can this be an exception?
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers

More information about the theme-reviewers mailing list