What are advantages of using google.load('jQuery', …) vs direct inclusion of hosted script URL?

前端 未结 7 2135
甜味超标
甜味超标 2020-12-04 17:07

Google hosts some popular JavaScript libraries at: http://code.google.com/apis/ajaxlibs/

According to google:

The most powerful way to load th

7条回答
  •  被撕碎了的回忆
    2020-12-04 17:27

    1. It allows you to dynamically load the libraries in your code, wherever you want.
    2. Because it lets you switch directly to a new version of the library in the javascript, without forcing you to rebuild/change templates all across your site.

提交回复
热议问题