views:

247

answers:

1

Anyone knows the difference?

The problem I met is that the page stops working correctly when opened by window.showModalDialog

+1  A: 

window.showModalDialog vs window.open

Window.open will open up a new window through Javascript, with the URL and other features of the window that u pass as parameters. Here the parent window which opens the new window and the child window are independent windows. Eg. Below

`window.open('winOpen.htm','name','height=255,width=250,toolbar=no,directories=no,status=no,
linemenubar=no,scrollbars=no,resizable=no');`

Window.showModalDialogue again works smilar to a window.open only diffrence being its a Modal window, It opens up as a new window but doesnt allow the user to access the parent window, unless you explicitly close it. Here the child window is dependent on the parent window. If you close the parent window the child would also get closed.

window.showModalDialog("xpopupex.htm","name","dialogWidth:255px;dialogHeight:250px");

ShowModalDialogue windows can be used when u want the user to perform a particular action in the new window before he access the parent window again. like login before he can access the parent page..

tryed to make it as simple as possible...hope this help.. ;)

Vipin