[wp-hackers] Overriding Default jQuery Script Generation?

Mike Schinkel mikeschinkel at newclarity.net
Thu Feb 5 20:32:14 GMT 2009


Hi all: 


I'm trying to write a plugin that uses jQuery and would like to get it from the Google AJAX hosting [1] using wp_enqueue_script() [2] like so: 

wp_enqueue_script('jquery',"http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js",array(),'1.2.6'); 

However, what is emitted as a response to the browser is: 

<script type='text/javascript' src='http://upsracing.loc/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script> 

Of course the scripts are the same but I'd like to get that tiny extra "oomph" from the liklihood someone already has the script cached from another site. 

Anyone know how do disable the default jQuery script generation so it will use the Google AJAX one? Thanks in advance. 

-Mike Schinkel 
http://mikeschinkel.com/ 

[1] http://code.google.com/apis/ajaxlibs/ 
[2] http://codex.wordpress.org/Function_Reference/wp_enqueue_script 


More information about the wp-hackers mailing list