Visit Mozilla.org

DOM:window.prompter

From MDC

This page has been flagged by editors or users as needing technical review

Until it is fully reviewed, it may contain inaccurate or incorrect information.

[edit] Summary

Returns a reference to an nsIPrompt instance, allowing to show dialogs parented to the current window.

Note: This property is only available to C++ code.

[edit] Syntax

window->GetPrompter(getter_AddRefs(prompt));

[edit] Example

nsCOMPtr<nsIDOMWindowInternal> window;  // assume assigned
nsCOMPtr<nsIPrompt> prompter;
window->GetPrompter(getter_AddRefs(prompter));
if (prompter) {
  prompter->Alert(
    NS_LITERAL_STRING("Dialog Title").get(),
    NS_LITERAL_STRING("This is the text of a dialog").get());
}