2010-12-23 39 views
6

使用下面的代碼行,就像大多數網站一樣,我是否想知道,是否可以爲此備份替代方案?例如,如果googleapis.com〜已關閉,請改用其他script srcJQuery備用備選方案

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> 

由於提前,

安德斯

回答

7

嘗試是這樣的:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> 

<script>if(typeof jQuery=="undefined"){document.write(unescape("%3Cscript src='/Scripts/jquery-1.4.3.min.js' type='text/javascript'%3E%3C/script%3E"));}</script>