2011-04-30 90 views
0

我玩弄延長谷歌Chrome和我有一個簡單的擴展與以下popup.html文件運行:谷歌Chrome擴展:popup.html JavaScript的jQuery的VS

<script type = "text/javascript"> 
    alert("hi from popup.html"); 
</script> 

<body> 
Hello World 
</body> 

只要我添加src屬性與谷歌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://*/*" 
    ] 
} 

爲什麼加入jQuery的源打破彈出?

+0

通常你只需將最新的'jquery.min.js'複製到你的擴展中,而不是從CDN中獲取它。 – icktoofay 2011-04-30 23:34:20

+1

這與Chrome或擴展無關。這是基本的Javascript:'