1.

Solve : accessing parent window of the modal dialog box ???

Answer»

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 ......

thanxCan 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 advanceThe 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:

Code: [Select]window.showModalDialog( 'modalwindow.html', window, '');Then in the modal box you can use:

Code: [Select]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 Quote

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 Quote
if u r free then plz answer my question
Okay.  Which question is that?actually what i post to this forums .....

have a good dayI think I've answered all the ones I've seen, that I can answer, but let me know if I missed one.  ok thanxxx


Discussion

No Comment Found