jqmodal 和 nyromodal 无法与 Jquery 1.3.2 和 Firefox 工具栏扩展一起使用
我一直在尝试使用 jqModal 或 nyroModal 打开和关闭模式对话框的命令创建自己的 Firefox 工具栏。 在这两种情况下,打开对话框的行为都会导致错误,并且我找不到任何关于模式会中断的原因。
浏览器:火狐3.0.11 jQuery:v1.3.2 jq模态:r14 nyroModal:1.5.0
示例 XUL: `
<!-- required JQuery dependency -->
<!--script src="chrome://jqmtoolbar/content/jquery.js" /-->
`<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" />
<!-- load main library -->
<script src="chrome://jqmtoolbar/content/jquery.nyroModal-1.5.0.pack.js" type="application/x-javascript" />
<script src="http://www.nopuck4you.com/gooble/jqModal-dev.js" type="application/x-javascript" />
<script src="chrome://jqmtoolbar/content/jqm.js" type="application/x-javascript" />
<toolbox id="navigator-toolbox">
<toolbar id="modal-toolbar" toolbarname="modal test toolbarx" accesskey="G"
class="chromeclass-toolbar" context="toolbar-context-menu"
hidden="false" persist="hidden">
<toolbarbutton id="gb-debug-jqmShow" tooltiptext="Show Modal"
label="Show Modal" oncommand="jqmShowModal(event)" />
<toolbarbutton id="gb-debug-jqmHide" tooltiptext="Hide Modal"
label="Hide Modal" oncommand="jqmHideModal(event)" />
<toolbarspring/>
<toolbarseparator/>
<toolbarbutton id="gb-debug-nyroShow" tooltiptext="Show Modal"
label="Show Modal" oncommand="nyroShowModal(event)" />
<toolbarbutton id="gb-debug-nyroHide" tooltiptext="Hide Modal"
label="Hide Modal" oncommand="nyroHideModal(event)" />
<toolbarspring/>
</toolbar>
</toolbox>
`
示例 jqm.js 文件: ` 函数 jqmShowModal(e) { //加载PageHeadElements(); var body = $(content.document).find("BODY"); if(body.find("#jqmModal").length == 0) body.prepend("你好jqModal!"); var jq = $("#jqmModal", content.document);
jq.jqm({
//set JQ modal parameters
ajax: "http://www.google.com",
modal: true,
onLoad: choke
});
$("#jqmModal").jqmShow();
//$("#goobModal", content.document).jqmShow();
函数
nyroShowModal(e) {
//loadPageHeadElements();
var body = $(content.document).find("BODY");
if(body.find("#nyroModal").length == 0) body.prepend("<div id=\"nyroModal\">Hello Nyro Modal!</div>");
var nym = $("#nyroModal", content.document);
nym.nyroModalManual({url: 'http://www.google.com'});
//nym.nyroModalManual({content: '<div>Hello from the test toolbar!</div>'});
}
函数扼流圈(e) { 警报('窒息!'); } `
I've been trying to create my own firefox toolbar with commands that will open and close a modal dialog using either jqModal or nyroModal. In both cases the act of opening the dialog causes errors and I can't find anything out there as to why modals would break.
Browser: Firefox 3.0.11
JQuery: v1.3.2
jqModal: r14
nyroModal: 1.5.0
Sample XUL:
`
<!-- required JQuery dependency -->
<!--script src="chrome://jqmtoolbar/content/jquery.js" /-->
`<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" />
<!-- load main library -->
<script src="chrome://jqmtoolbar/content/jquery.nyroModal-1.5.0.pack.js" type="application/x-javascript" />
<script src="http://www.nopuck4you.com/gooble/jqModal-dev.js" type="application/x-javascript" />
<script src="chrome://jqmtoolbar/content/jqm.js" type="application/x-javascript" />
<toolbox id="navigator-toolbox">
<toolbar id="modal-toolbar" toolbarname="modal test toolbarx" accesskey="G"
class="chromeclass-toolbar" context="toolbar-context-menu"
hidden="false" persist="hidden">
<toolbarbutton id="gb-debug-jqmShow" tooltiptext="Show Modal"
label="Show Modal" oncommand="jqmShowModal(event)" />
<toolbarbutton id="gb-debug-jqmHide" tooltiptext="Hide Modal"
label="Hide Modal" oncommand="jqmHideModal(event)" />
<toolbarspring/>
<toolbarseparator/>
<toolbarbutton id="gb-debug-nyroShow" tooltiptext="Show Modal"
label="Show Modal" oncommand="nyroShowModal(event)" />
<toolbarbutton id="gb-debug-nyroHide" tooltiptext="Hide Modal"
label="Hide Modal" oncommand="nyroHideModal(event)" />
<toolbarspring/>
</toolbar>
</toolbox>
`
Sample jqm.js file:
`
function jqmShowModal(e)
{
//loadPageHeadElements();
var body = $(content.document).find("BODY");
if(body.find("#jqmModal").length == 0) body.prepend("Hello jqModal!");
var jq = $("#jqmModal", content.document);
jq.jqm({
//set JQ modal parameters
ajax: "http://www.google.com",
modal: true,
onLoad: choke
});
$("#jqmModal").jqmShow();
//$("#goobModal", content.document).jqmShow();
}
function nyroShowModal(e)
{
//loadPageHeadElements();
var body = $(content.document).find("BODY");
if(body.find("#nyroModal").length == 0) body.prepend("<div id=\"nyroModal\">Hello Nyro Modal!</div>");
var nym = $("#nyroModal", content.document);
nym.nyroModalManual({url: 'http://www.google.com'});
//nym.nyroModalManual({content: '<div>Hello from the test toolbar!</div>'});
}
function choke(e)
{
alert('choke!');
}
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来处理这个问题的唯一方法是通过工具栏面板对象而不是模式窗口。
Looks like the only way to handle this is through the Toolbar Panel object instead of modal windows.