[theme-reviewers] Integrating JavaScript

Chip Bennett chip at chipbennett.net
Thu Jul 14 12:24:56 UTC 2011


If you ignore the HTML5-generated validation errors, the
WordPress-introduced validation errors (e.g. multiple searchforms using the
same #id), and the browser-prefix property CSS validation errors, see if
there's anything left.

You may be increasing PHP calls, but proper script enqueueing is vitally
important for publicly released Themes. Basically, it helps ensure that your
Theme plays nicely with Plugins, and also with Child Themes. It is also a
requirement for passing Theme Review.

Chip

On Thu, Jul 14, 2011 at 7:16 AM, Karthik K <karthikthephoenix at gmail.com>wrote:

> Oh! Ok. Thanks for the quick tip Chip. But what about the other errors? And
> I will try out and let you know about the enqueue and register functions.
> But doesn't this increase the PHP calls?
>
> _
> Karthik.K
> Contact Me: [image: Twitter] <http://twitter.com/ImKarthikK>[image:
> Facebook] <http://www.facebook.com/ImKarthikK>[image: Linkedin]<http://www.linkedin.com/in/karthikk88>[image:
> Flickr] <http://www.flickr.com/ImKarthikK/show>[image: Youtube]<http://www.youtube.com/ImKarthikK>[image:
> Blog RSS] <http://www.karthikk.net/>
>
>
>
>
> On Thu, Jul 14, 2011 at 5:44 PM, Chip Bennett <chip at chipbennett.net>wrote:
>
>> Those scripts look fine to include; however, you will need to register and
>> enqueue them properly, using wp_register_script() and wp_enqueue_script(),
>> via a function hooked into the wp_enqueue_scripts hook.
>>
>>  As for the W3C validator results: the validator still basically sucks at
>> validating HTML5 markup. Also, you can safely ignore browser-prefix property
>> errors.
>>
>> Chip
>>
>> On Thu, Jul 14, 2011 at 7:07 AM, Karthik K <karthikthephoenix at gmail.com>wrote:
>>
>>> Hi All,
>>> I've got a query. I'm building my own theme and I'm looking if I could
>>> include an external JavaScript within a .js file. Example:
>>>
>>> <script>
>>> <script type="text/javascript" src="
>>> http://platform.twitter.com/widgets.js"> </script>
>>> <script type="text/javascript" src="http://platform.linkedin.com/in.js">
>>> </script>
>>> <script type="text/javascript" src="http://apis.google.com/js/plusone.js">
>>> </script>
>>> <script src="
>>> http://connect.facebook.net/en_US/all.js#appId=213854785325012&amp;xfbml=1<http://connect.facebook.net/en_US/all.js#appId=213854785325012&xfbml=1>
>>> ">
>>> <script src="http://connect.facebook.net/en_US/all.js#xfbml=1">
>>> </script>
>>> </script>
>>>
>>> Please help me on this. And I'm also looking at troubleshooting the W3C
>>> Validation for www.karthikk.net
>>> _
>>>
>>> Karthik.K
>>> Contact Me: [image: Twitter] <http://twitter.com/ImKarthikK>[image:
>>> Facebook] <http://www.facebook.com/ImKarthikK>[image: Linkedin]<http://www.linkedin.com/in/karthikk88>[image:
>>> Flickr] <http://www.flickr.com/ImKarthikK/show>[image: Youtube]<http://www.youtube.com/ImKarthikK>[image:
>>> Blog RSS] <http://www.karthikk.net/>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
> _______________________________________________
> 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/20110714/507a26f2/attachment-0001.htm>


More information about the theme-reviewers mailing list