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

WPForever Team hi at wpforever.com
Wed Oct 17 13:12:09 UTC 2012


I was building a framework (a hybrid of framework and parent theme), and 
wanted to include just that one line of code in it, so the themes built 
on it wouldn't need to include it.

Adding another HTTP request would be pointless for a single line of 
JavaScript.

Chip Bennett wrote:
>
> Is there any particular reason that such a script can't be enqueued
> like most other scripts, that would warrant such an exception?
>
> Chip
>
> On Tue, Oct 16, 2012 at 12:02 PM, WPForever Team <hi at wpforever.com
> <mailto: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
> <mailto: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/20121017/3710d31c/attachment.htm>


More information about the theme-reviewers mailing list