用visual studio 2010开发ASP.NET应用程序
我是jquery的新手。
我正在尝试包括JQuery文件在线(从谷歌)
为此,我将其写为:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>这里用绿色文本突出显示src属性,显示工具提示:
//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js not found.如果我把它写成:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>它向我展示了错误作为tooptip:
Element 'script' is missing required attribute 'type'但这是我在不同网站上引用这句话的实际方式。
我已经从不同的网站引用了这个地址。
这个地址是不是错了?或
我写错了吗?
请帮帮我。
发布于 2013-05-21 15:31:28
当在浏览器中打开时,无协议路径继承当前文档的协议,因此当您的页面通过http/https协议打开时,这将起作用。
因此,我假设您的VS将无协议路径解释为本地路径,因此找不到它。
您可以通过http/https协议直接打开链接,查看CDN URL是否正确:
http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
发布于 2013-05-21 15:28:02
use it like this. it works
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>https://stackoverflow.com/questions/16664352
复制相似问题