javascript - calling a java script file type -


i noticed programmers use 2 ways of calling .js file.

1- way must have js file:

<script src="lib/jquery.js" type="text/javascript"></script> 

2- , way don't need js file :

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

and want know way better use.

the first option using local files, second option using cdn.

a cdn group of fast servers several common use files. useful save bandwidth , speed download of site.

however, mentioned, have problems if end user don't have access internet.

basically, if expect application executed online, cdn great option. if developing app executed offline (like crm company) better served using local files.

if cdn down, website broke. more website down cdn.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -