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

WPForever Team hi at wpforever.com
Tue Oct 16 17:11:03 UTC 2012


Ah, didn't know that.

They do it after <body> because they're changing the class of <body>, I 
was thinking of doing this to <html>. Either way is fine.

Otto wrote:
>
> 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');
> </script>
>
> -Otto
>
>
> 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
>>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20121016/96db4160/attachment.htm>


More information about the theme-reviewers mailing list