Replace jQuery of WordPress with Google AJAX Library


Sponsored Links






I will show you little code How To Replace jQuery of WordPress in your Theme with Google AJAX Library, like we all know, WordPress has built in a lot of JavaScript Framework included jQuery, but for some reason such as Sever Speed or better handling, we need replace original jQuery for WordPress and using Google AJAX Library.

Replace jQuery of WordPress - Shakira Cleverage Photo

Replace jQuery of WordPress - Shakira Cleverage Photo

To use this featured is simple, we need put some code in our functions.php and your WordPress will use Google AJAX Library. Let’s get started

function jQuery_Google_init() {
	if ( !is_admin() ) { // actually not necessary, because the Hook only get used in the Theme
		wp_deregister_script( 'jquery' ); // unregistered key jQuery
		wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.4.2'); // register key jQuery with URL of Google CDN
		wp_enqueue_script( 'jquery' ); // include jQuery
	}
}
// For Themes since WordPress 3.0
add_action( 'after_setup_theme', 'jQuery_Google_init' ); // Theme active, include function

On this example, we use wp_enqueue_script() to do this tricks, thanks for WP Engineer to share it, now you can Replace jQuery of WordPress with Google AJAX Library more easier right?

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Using jQuery 1.4 as Default on WordPress

How to use jQuery 1.4 by default on WordPress, this tricks is useful for some WordPress Developer and need using New Version of jQuery, like we all know, jQuery still using old version jQuery 1.3.x, but if you really need … Read More

jQuery noConflict wrappers on WordPress

WordPress is wonderful publishing platform with many JavaSript Framework including jQuery. Until today jQuery is one of my favorite JavaScript library, it's more easy, a lot of plugin available and I have wonderful jQuery guru ;) Some problem on j

How To inserting Google Maps into WordPress

Today Tutorial is How To inserting Google Maps into WordPress Posts/Pages without Plugin, we only need to write Google Maps shortcode and we can put our own maps with really easy ways. The first time is write down this code … Read More

The Best way to replace words in your posts

Like we all know, WordPress is the most promising publishing platform, it's free and easy to tweak or installed new themes or plugin. Or if we have little bit knowledge in PHP Programming we can enhanced our WordPress more easily. … Read More

Replace Content on Your WordPress using SQL

Like we all know, we can use SQL to replace or remove some content in our WordPress using phpMyAdmin, on this post I will show you How To Replace/Remove Content on Your WordPress using SQL. On this trick you can … Read More

The Creative Solution to Insert Google Analytics on WordPress

Every Blogger need stats, there are so many stats tools available on the net. My Favorite stats tools is WordPress Stats and Google Analytics, On this trick we will show tricks how to added Google Analytics into yours wordpress blog, … Read More

Replace default WordPress jQuery script with Google Library

Easy tutorial that lets you replace the default WordPress jquery script with Google Library API. script('jquery'); wp_register_script('jquery', 'http://ajax read more

Source: http://www.wpbeginner.com/wp-themes/replace-default-wordpress-jquery-script-with-google-library/

5 Tips For Using jQuery with WordPress / Eric Martin

You can replace my_init with something more meaningful, but Load jQuery from the Google AJAX Library. Since WordPress includes jQuery, calling wp_enqueue_script('jquery read more

Source: http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/

Small Tips Using WordPress and jQuery - WP Engineer

after_setup_theme since WordPress 3.0; Replace jQuery of WordPress in your Theme with Google AJAX Library. In the following code the jQuery-Library of Google CDN gets loaded read more

Source: http://wpengineer.com/2028/small-tips-using-wordpress-and-jquery/

jQuery: The Write Less, Do More, JavaScript Library

jQuery is a new kind of JavaScript Library. jQuery is a fast traversing, event handling, animating, and Ajax Who's using jQuery? Google; Dell; Bank of America; Major League read more

Source: http://jquery.com/

What Is the Difference Between Google jQuery & WordPress jQuery

Between Google jQuery & WordPress jQuery to reference the jQuery library file because WordPress in mind that WordPress uses jQuery in compatibility mode, so replace read more

Source: http://www.ehow.com/info_10065826_difference-between-google-jquery-wordpress-jquery.html


6 Responses to Replace jQuery of WordPress with Google AJAX Library

  1. Pingback: wp-popular.com » Blog Archive » Replace jQuery of WordPress with Google AJAX Library # WordPress Tricks & Tips

  2. Pingback: WordPress jQuery durch die Google AJAX Library ersetzen

  3. Pingback: WordPress Themehacks » WordPress jQuery durch Google AJAX Library ersetzen

  4. Ma'moun says:

    Why do you think we should do this? Is it any better?

  5. Pingback: The Creative Solution to Insert Google Analytics on WordPress | WordPress News Wire

  6. Natan says:

    You can also use the same trick to remove the need for jquery in the embed script when embedding surveys into wordpress using Rational Survey.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>