Mit*_*tya 0 jquery google-chrome
我正在玩扩展谷歌浏览器,我有一个简单的扩展名运行与以下popup.html文件:
<script type = "text/javascript">
alert("hi from popup.html");
</script>
<body>
Hello World
</body>
Run Code Online (Sandbox Code Playgroud)
一旦我将带有url的src属性添加到google jquery CDN'alert("来自popup.html");' 不再运行.
我的清单文件如下:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"background_page": "background.html",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
},
"permissions": [
"tabs","http://*/*","https://*/*"
]
}
Run Code Online (Sandbox Code Playgroud)
为什么添加jquery源会破坏弹出窗口?
您需要将脚本分成两个语句.试试这个:
<script type="text/javascript" src="jQuery.js"></script>
<script type="text/javascript">
alert("hi from popup.html");
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2946 次 |
| 最近记录: |