开发者

Enabling and disabling CDN via ScriptManager

开发者 https://www.devze.com 2023-01-21 22:37 出处:网络
I want to use the Microsoft\'s CDN fo开发者_运维问答r hosting the AJAX Library for my .NET 4.0 web application.However, I was asked to implement a fallback for when the CDN isn\'t available or when de

I want to use the Microsoft's CDN fo开发者_运维问答r hosting the AJAX Library for my .NET 4.0 web application. However, I was asked to implement a fallback for when the CDN isn't available or when developers want to develop locally without internet. In these scenarios the ScriptManager should send the locally hosted copies rather than the CDN copies of the JavaScript. I know I can manually disable the CDN in the scriptmanager, but this can be tedious and potentially lead to missed configurations reaching production.

Is there a more elegant way to use a local copy of the JavaScript files without manually disabling CDN in every spot in code via ScriptManager?


Taken from html5 boiler plate

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script%3E'))</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消