Computer Hope
Internet & Networking => Web design => Topic started by: dmjpro on March 07, 2007, 02:36:38 AM
-
i want to access the parent window (opener window) from a modal dialog box ....
can't i do that using window.opener from modal dialog box .....
i did it but i failed .... plz help me out ......
one guy from another forum answered me that it can be only done using .....
window.dialogArguments..... but my window.showModalDialog code already written... in many palces .....
how can i do that ......
thanx
-
Can you provide a link to the page in question please? There is more than one way to create a modal dialogue box in javascript.
-
sooryy for late response .....
my code is something like this ....
the JS code of parent window....
//Some code
window.showModalDialog(URL);
the JS code of modal dialog window
//Some code ...
here i want to access the parent window without sending the window_ref as dialog_wrgs
here i can't access the parent window using window.opener
here what should i insert code to access the parent window
plz help me out .. i m struggling out for a 10-15 days
thanxxxxxx in advance
-
The first thing you need to know is that showModalDialog() is not cross-browser compatible, and therefore its use should be avoided. What you are attempting will not work in Firefox, for example.
That said, you are correct in thinking that this kind of modal dialog box does not automatically have access to the parent window. You need to pass a reference to the parent like this:
window.showModalDialog( 'modalwindow.html', window, '');
Then in the modal box you can use:
var parentwin = window.dialogArguments;
-
our client uses the IE so there is no cross browser compatibility checking....
so without sending args from parent window i can't access the parent window anyway ....??? right.....
ok thanx for ur reply
-
so without sending args from parent window i can't access the parent window anyway ....??? right.....
That's certainly my understanding. But as I said, there are other forms of (cross-browser compatible) modal dialogues that might provide more functionality.
-
thanx for ur details .....
hellooo Rob Pomeroy if u r free then plz answer my question .... thanxx a lot for ur guidance for a last three dayssss
have a good day
-
if u r free then plz answer my question
Okay. Which question is that?
-
actually what i post to this forums .....
have a good day
-
I think I've answered all the ones I've seen, that I can answer, but let me know if I missed one. :)
-
ok thanxxx