Due to the current instability of Google and the lack of good similar services in China, this is no longer the optimal solution. Of course, if you change the Google library path to a domestic stable and fast path (if it exists), you can still benefit from the various benefits brought by this method. Even so, all things considered, Google is still the most suitable.
Although the jQuery library of Google CDN is used in website development projects to load very quickly, only calling the library of the local server can ensure that it is foolproof. If you use WordPress's built-in jQuery library, the jQuery.noConflict() added at the end to prevent JS library conflicts will make all jQuery codes in the theme need to be slightly modified, which may also cause some plug-in effects to fail. I think the method used by Paul Irish in HTML5 Boilerplate is very good and I would like to share it with you.
Usage
Use the following code to load the local jQuery library when the Google CDN library fails to be obtained:
The method used in WordPress themes is:
Notes Because of the reasons mentioned at the beginning, it is recommended to download a jQuery official Min library and put it in the theme directory currently used by WordPress. Do not use wp. -Libraries in included.
The address of the Google CDN library uses a protocol relative path, which can effectively solve some problems caused by https. For details, please see Paul Irish's introduction. Of course, you can still use the path with "http:".
Many websites use the jQuery library provided by Google CDN, which can achieve excellent caching effects.
Putting all the jQuery code at the bottom of the page can improve the loading speed.
Pages reconstructed using HTML5 can omit type="text/javascript".
Use SAE developer resources Due to recent problems with Google services, for the sake of safety, using SAE developer resources is a good way to save traffic and increase speed. SAE is a developer resource provided by Sina for its applications, including the jQuery library. It is very simple to use. Just go to the SAE Developer Center to find the appropriate address and replace the Google CDN address in the above code. For example: