Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIPrompt

This is the prompt interface which can be used without knowledge of a parent window. The parentage is hidden by the GetInterface though which it is obtained.
继承于: nsISupports 最后修改于Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)

注: 本接口基本等价于nsIPromptService,只是没有parent nsIDOMWindow这个参数.为了避免重复的文档,下面的所有方法都链接到了nsIPromptService.如果你准备使用这个接口,一定要删除那些方法中的nsIDOMWindow参数.

Normally you would use the prompt service as it is more flexible, but sometimes a callback will request an nsIPrompt via nsIInterfaceRequestor.getInterface(). To get an instance, call the nsIWindowWatcher.getNewPrompter().

方法概述

void alert(in wstring dialogTitle, in wstring text);
void alertCheck(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue);
boolean confirm(in wstring dialogTitle, in wstring text);
boolean confirmCheck(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue);
PRInt32 confirmEx(in wstring dialogTitle, in wstring text, in unsigned long buttonFlags, in wstring button0Title, in wstring button1Title, in wstring button2Title, in wstring checkMsg, inout boolean checkValue);
boolean prompt(in wstring dialogTitle, in wstring text, inout wstring value, in wstring checkMsg, inout boolean checkValue);
boolean promptPassword(in wstring dialogTitle, in wstring text, inout wstring password, in wstring checkMsg, inout boolean checkValue);
boolean promptUsernameAndPassword(in wstring dialogTitle, in wstring text, inout wstring username, inout wstring password, in wstring checkMsg, inout boolean checkValue);
boolean select(in wstring dialogTitle, in wstring text, in PRUint32 count, [array, size_is(count)] in wstring selectList, out long outSelection);

常量

nsIPrompt中的按钮标识同样等同于nsIPromptService.Constants中定义的那些.示例代码可以在这里找到: 使用按钮标识

相关链接

nsIPromptService

文档标签和贡献者

 此页面的贡献者: ziyunfei
 最后编辑者: ziyunfei,