★ wanayoo — archive 1999 https://developer.mozilla.org/pl/docs/Web/API/Window/importDialogNouvelle recherche | Portail wanayoo

Join MDN and developers like you at Mozilla's View Source conference, November 2-4 in Portland, Oregon. Learn more at https://viewsourceconf.org/.

Window.importDialog()

Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!

Summary

Because opening windows on mobile isn't necessarily appropriate, the Firefox Mobile team designed the importDialog() method to replace window.openDialog(). Instead of opening a new window, it merges the specified XUL dialog into the main window.

Syntax

newDialog = importDialog(aParent, aSrc, aArguments) 
newDialog
The opened window
aParent
The dialog's parent; can be null.
aSrc
The chrome URL of the XUL dialog.
aArguments
A JavaScript object containing data to pass to the dialog.

Example

var dialog = importDialog(null, "chrome://myextension/content/dialog.xul", myObject);

Notes

The XUL passed to importDialog() is very similar to XUL passed to window.openDialog(), with some limitations and caveats:

  • Only <dialog> top level elements are permitted.
  • Scripts are loaded via an attribute on the <dialog> element, not via the <script> tag.

The XUL is merged into the existing window, almost like a XUL overlay. Because of this, element ID and JavaScript conflicts are possible, just like overlays. So be careful.

Specification

DOM Level 0. Not part of any standard.

Autorzy i etykiety dokumentu

Contributors to this page: fscholz, MHasan, teoli, kscarfone, Sheppy, damien.flament, Sonnyp
Ostatnia aktualizacja: fscholz,
Ukryj panel boczny