防止页面产生更多对话

时间:2011-07-26 06:37:48

标签: javascript prototypejs firefox4

Firefox4有一项新功能→【防止此页面创建其他对话框】

但是当我希望不止一次打开警报对话框时,这对我来说也是一个麻烦。

现在,出现了一个新问题......如下↓

1) I call the alert dialog more than once , and check the  
  【Prevent this page from creating additional dialogs】
2) I click a download button , My web application is down.... 

(我的按钮'事件在下面....因为它没有进入动作,所以我只是编写客户端源....)

我的按钮事件

getDownloadFile:function(){
    $('xform').submit();
}

我的网页代码

<div style="display:none;">
    <form id="xform" action="down.do" method="post" target="xfra">
    </form>
</div>
<iframe id="xfra" name="xfra" src="/?scid=dummy.htm" style="width:0px;height:0px;visibility:hidden;"></iframe>

希望有人能帮助我......谢谢......

2 个答案:

答案 0 :(得分:0)

我猜你的代码上的$意味着你正在使用jQuery(如果是这种情况你应该在标签中提及它)。

<击>

如果你不使用jQuery,那么我不太了解其他框架的选择器。但是,如果它是jQuery,你的选择器不正确,它应该是:

$('#xform').submit();

$('xform').submit();

<击> 由于您使用的是PrototypeJS,因此上述内容不正确。

答案 1 :(得分:0)

以下是一个简单的修复

first_match = next((item for item in list if ".git" in item), None)
if first_match is not None:
    print first_match,