📜 ⬆️ ⬇️

JavaScript frameworks can now be hosted on Google

The AJAX Search API blog was announced yesterday by the AJAX Libraries API . The bottom line is that Google now allows everyone to use JavaScript frameworks hosted on their servers. The API itself is an easy-to-use mechanism for connecting HTML documents to the most popular JS libraries, including jQuery, prototype, script.aculo.us, MooTools, and dojo. The list is likely to expand.

Connect the necessary library in two ways. The first is trivial, using an HTML script element.

  <code> <script src = "http://ajax.googleapis.com/ajax/
 libs / prototype / 1.6.0.2 / prototype.js "> </ script> </ code> 

')
As it is not difficult to guess, instead of prototype/1.6.0.2 you can specify the name of any other framework and its version.

The second method is more flexible. Using the special JS method google.load() you can specify the version of the library not exactly, but by the first digits.

  <code> <script src = "http://www.google.com/jsapi"> </ script>
 <script>
 google.load ("prototype", "1.6");
 // ...
 </ script> </ code> 


The value “1.6” specified in the example means that the most recent prototype version in the 1.6 branch will be automatically selected. Thus, the AJAX Libraries API can provide auto-update of JS libraries without any changes in the calling script (naturally, such an update is limited to the limits of the desired branch).

The main advantages of using the AL API include the following:



Related Links





Crosspost with paradigm.ru .

Source: https://habr.com/ru/post/26344/


All Articles