Arguments can only be passed with window.showModalDialog which is quite helpful. But consider your application is using these arguments extensively in your website and suddenly it appears modal dialog is not supported on all browsers. Opera does not support modal dialog, now instead of changing the existing functionality the work around would be as follows:-
1. Detect if browser support modal dialog or not and then assign arguments
2. Now inside the pop-up window access the arguments
Now this should work like a charm.
Man is still the most extraordinary computer of all. ~John F. Kennedy
1. Detect if browser support modal dialog or not and then assign arguments
var vArguments = new Object(); vArguments.test1 = "test1 data"; vArguments.test2 = "test2 data"; if (window.showModalDialog) { window.showModalDialog(sURL, vArguments, sFeatures); } else { window.dialogArguments = vArguments; window.open(sURL, "_blank", sFeatures); }
2. Now inside the pop-up window access the arguments
var dialogArguments ; if (window.showModalDialog) { dialogArguments = window.dialogArguments; } else { dialogArguments = window.opener.dialogArguments; } alert(dialogArguments.test1); alert(dialogArguments.test2);
Now this should work like a charm.
Man is still the most extraordinary computer of all. ~John F. Kennedy