One js Code that supports ff modaldialog. This is another method I have seen. Although it is still not very good, it is also good to understand. Currently, the Code does not support opera, I don't have time to check whether = is supported. =
Original address: http://www.koders.com/javascript... 882713BA1C7DD0. aspx
Script // Though "Dialog" looks like an object, it isn' t really an object. instead // it's just namespace for protecting global symbols. function Dialog (url, action, init) {if (typeof init = "undefined") {init = window; // pass this window object by default} if (document. all) {// here we hope that Mozilla will never support document. all var value = showModalDialog (url, init, // window. open (u Rl, '_ blank', // "resizable: no; help: no; status: no; scroll: no"); "resizable: yes; help: no; status: no; scroll: no "); if (action) {action (value) ;}} else {return Dialog. _ geckoOpenModal (url, action, init) ;}}; Dialog. _ parentEvent = function (ev) {if (Dialog. _ modal &&! Dialog. _ modal. closed) {Dialog. _ modal. focus (); // we get here in Mozilla only, anyway, so we can safely use // the DOM version. ev. preventDefault (); ev. stopPropagation () ;}}; // shocould be a function, the return handler of the currently opened dialog. dialog. _ return = null; // constant, the currently opened dialog Dialog. _ modal = null; // the dialog will read it's args from this variable Dialog. _ arguments = null; Dialog. _ geckoOpenModal = function (url, action, init) {var dlg = window. open (url, "ha_dialog", "toolbar = no, menubar = no, personalbar = no, width = 10, height = 10," + "scrollbars = no, resizable = no "); Dialog. _ modal = dlg; Dialog. _ arguments = init; // capture some window's events function capwin (w) {w. addEventListener ("click", Dialog. _ parentEvent, true); w. addEventListener ("mousedown", Dialog. _ parentEvent, true); w. addEventListener ("focus", Dialog. _ parentEvent, true) ;}; // release the captured events function relwin (w) {w. removeEventListener ("focus", Dialog. _ parentEvent, true); w. removeEventListener ("mousedown", Dialog. _ parentEvent, true); w. removeEventListener ("click", Dialog. _ parentEvent, true) ;}; capwin (window); // capture other frames for (var I = 0; I <window. frames. length; capwin (window. frames [I ++]); // make up a function to be called when the Dialog ends. dialog. _ return = function (val) {if (val & action) {action (val) ;}relwin (window); // capture other frames for (var I = 0; I <window. frames. length; relwin (window. frames [I ++]); Dialog. _ modal = null ;};}; Dialog (" http://google.com ", Function () {alert ('test')}, null); script
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]