Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Load Jquery from Google

  1. #1
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts

    Load Jquery from Google

    Is this worth pursuing? i haven't been able to find any jquery code mentioned in this article some of the CP theme files:

    jQuery is used a lot to make effects, like dropping down a menu. WP theme developers choose jQuery not only because it’s popular, but also because it comes together with WordPress, just in the wp-includes/js/jquery folder, WordPress uses it widely in the admin panel. So just check the home page source, if you can find ‘/wp-includes/js/jquery/jquery.js’, then your wp theme needs jQuery.

    jQuery is a big library, over 50K normally, loading it from somewhere else not only saves your bandwidth, but also increases the page speed, as normally the brower won’t generate too many requests to the same sever at the same time. And even better, this “somewhere else” is Google, which is fast and stable!

    Here it is, the latest jQuery from Google:

    http://ajax.googleapis.com/ajax/libs.../jquery.min.js

    here is the documents.


    So now, you just need to replace the jQuery path from ‘http://yourserver/wp-includes/js/jquery/jquery.js’ to ‘http://ajax.googleapis.com/ajax/libs...jquery.min.js’.

    Firstly, please check the header.php file in the theme folder you use. If you find the jquery path, well, you can just replace that.

    If not, well, it must be generated by the function wp_head(). Here is what you need to do:

    Check the functions.php file in the same folder, find something like this:

    function my_jquery_init() {
    wp_enqueue_script('jquery');
    }

    The key part is “wp_enqueue_script('jquery')“, if not find this, try to find “jquery.js”. What we want to do here is to remove the code that generate the jQuery script tag, like just removing the line “wp_enqueue_script('jquery');“.

    Then add this line to the header.php, just before </head>:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    Now, check the page source, make sure the jQuery path been replaced.

  2. #2
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,940
    Thanks
    158
    Thanked 2,868 Times in 2,744 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  4. #4
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #5
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,940
    Thanks
    158
    Thanked 2,868 Times in 2,744 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  6. #6
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #7
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,940
    Thanks
    158
    Thanked 2,868 Times in 2,744 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  8. #8
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #9
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,940
    Thanks
    158
    Thanked 2,868 Times in 2,744 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  10. #10
    Thread Starter
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Issues adding anything with jquery
    By reboot in forum ClassiPress General Discussion
    Replies: 3
    Last Post: July 5th, 2011, 01:08 PM
  2. [SOLVED] BUG - reload url with hash mark for comment (tabs then don't load)
    By reboot in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: January 7th, 2011, 07:14 PM
  3. A list of Classipress-Site load times.
    By McGee in forum Report ClassiPress Bugs
    Replies: 5
    Last Post: November 29th, 2010, 11:24 AM