[wp-hackers] wp_register_script vs wp_enqueue_script vs <script />

Ozh ozh at planetozh.com
Sun May 4 16:10:39 GMT 2008


About wp_enqueue_script() vs echo "<script>" : using
wp_enqueue_script() will allow for dependencies check and will only
load once.
Doing an echo "<script>" could result in a JS lib being included
twice, which is a waste.

if your script is a jquery plugin, just wp_enqueue_script('myscript',
'url of your script', array('jquery')) and rest assured everything
will always work.

On Sun, May 4, 2008 at 5:21 PM, Eric Marden <wp at xentek.net> wrote:
> Other than the dependency checking, is there any advantage to using
> wp_register_script over wp_enqueue_script (vs. just pulling it in with a
> standard <script> tag)?
>
>  My script is a jquery plugin, but since my theme already has it included I
> know its been loaded. Is there anything else it does that would warrant its
> use?
>
>  -e
>  _______________________________________________
>  wp-hackers mailing list
>  wp-hackers at lists.automattic.com
>  http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
http://FrenchFragFactory.net ~ Daily Quake News
http://planetOzh.com ~ Blog and WordPress Stuff


More information about the wp-hackers mailing list