What would be a good way to attempt to load the hosted jQuery at Google (or other Google hosted libs), but load my copy of jQuery if the Google attempt fails?
(什么是尝试在Google (或其他Google托管库)上加载托管jQuery ,但如果Google尝试失败则加载我的jQuery副本的好方法?)
I'm not saying Google is flaky.
(我并不是说Google很脆弱。)
There are cases where the Google copy is blocked (apparently in Iran, for instance). (在某些情况下,Google副本被阻止(例如,显然在伊朗)。)
Would I set up a timer and check for the jQuery object?
(我会设置一个计时器并检查jQuery对象吗?)
What would be the danger of both copies coming through?
(两份复印件通过的危险是什么?)
Not really looking for answers like "just use the Google one" or "just use your own."
(并非真正在寻找诸如“仅使用Google一个”或“仅使用您自己的一个”之类的答案。)
I understand those arguments. (我理解那些论点。)
I also understand that the user is likely to have the Google version cached. (我也了解用户很可能已经缓存了Google版本。)
I'm thinking about fallbacks for the cloud in general. (我通常在考虑云的回退。)
Edit: This part added...
(编辑:这部分添加...)
Since Google suggests using google.load to load the ajax libraries, and it performs a callback when done, I'm wondering if that's the key to serializing this problem.
(由于Google建议使用google.load加载ajax库,并且完成后会执行回调,所以我想知道这是否是序列化此问题的关键。)
I know it sounds a bit crazy.
(我知道这听起来有点疯狂。)
I'm just trying to figure out if it can be done in a reliable way or not. (我只是想弄清楚它是否可以可靠地完成。)
Update: jQuery now hosted on Microsoft's CDN.
(更新:jQuery现在托管在Microsoft的CDN上。)
http://www.asp.net/ajax/cdn/
(http://www.asp.net/ajax/cdn/)
ask by Nosredna translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…