Google Jsapi hosting your JS library

Source: Internet
Author: User
Tags hosting

Take a look at JS:

<script type= "Text/javascript" src= "Http://www.google.com/jsapi" ></script><script type= "text/ JavaScript ">        google.load (" Search "," 1 ");        Google.load ("Language", "1"); </script>

Today, a little friend asked me what the following JS means-_-! I can only say that I do not know ... So began the cheerful Baidu. Know this, is Google's JS file hosting, call the following way:

<script type= "Text/javascript" >  google.load ("jquery", "1.3.2");//Load jquery 1.3.2  

This allows us to upload the jquery 1.3.2 version of JS Library from Google's latest CDN image, and then we can write the JS code normally. However, even if it is a CDN image of Google, the download will take time after all, in case the code base has not been downloaded and the browser has explained the following code to do? We can set the JS library to start after the execution of JS:

<script type= "Text/javascript" >google.load ("jquery", "1.3.2"); Load the jquery 1.3.2google.setonloadcallback (function () {////Execute code $ ("body") after loading complete. HTML ("Hello world!");}); </script>

from: HTTP://HI.BAIDU.COM/KAIXINGUODU/ITEM/0F75CD83E0272BE9E496E0A3

However, now the domestic Google is wall, so, if you want to managed code, GitHub hosting is also good oh.

Google Jsapi hosting your JS library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.