【发布时间】:2012-12-10 18:34:07
【问题描述】:
我是制作 chrome 扩展的新手。我只是想构建一些简单的扩展来开始。但是我发现扩展中的弹出窗口在 jquery 中没有任何影响。尽管其他一些功能有效,但效果不可见。谁能给我一个线索?
【问题讨论】:
标签: jquery google-chrome google-chrome-extension popupwindow
我是制作 chrome 扩展的新手。我只是想构建一些简单的扩展来开始。但是我发现扩展中的弹出窗口在 jquery 中没有任何影响。尽管其他一些功能有效,但效果不可见。谁能给我一个线索?
【问题讨论】:
标签: jquery google-chrome google-chrome-extension popupwindow
我不确定你从哪里找到However I found that the popup window in the extension don't have any effect in jquery. Though some other functions work, the effect is not visible.
jquery可以在弹出窗口中使用。
参考文献
a) jquery
c) CSP
示例演示
manifest.json
清单文件中已注册的浏览器操作
{
"name": "Jquery Demo",
"version": "0.0.1",
"manifest_version": 2,
"description": "This demonstrates how Jquery works in popup",
"browser_action":{
"default_popup":"popup.html",
"default_icon":"screen.png"
}
}
popup.html
使用 Js 文件 a) Jquery b) 以建议的方式自定义文件以避免内联脚本 (CSP)。
<html>
<head>
<script src="jquery.js"></script>
<script src="myjs.js"></script>
</head>
<body></body>
</html>
myjs.js
我使用实时功能进行演示,您可以在此处使用所有支持的功能。
// You can use all methods of jquery here
//$(selector).live(events, data, handler);
如果您需要更多信息,请告诉我。
【讨论】: