Connecting Tech Pros Worldwide Help | Site Map

Parent Window is Redirecting after modal dialog closes

Foehammer
Guest
 
Posts: n/a
#1: Jul 23 '05
I have the following snippet of code:

function ShowTutorial(tutorialPath)
{
var ret = showModalDialog(tutorialPath, '',
'dialogWidth:' + screen.width + '; dialogHeight: ' + screen.height +
'; '
+ 'resizable: no; help: no; status: no; scroll: no; '
+ 'dialogLeft:0; dialogTop:0;');

return;

}

This function is called when an image is clicked. I intend for it to
display a popup window with a flash file (I haven't created the flash
files yet, so I am testing with a simple HTML document). The dialog
pops up correctly in IE (but not in Firefox or any other REAL
browser). However, when I close the dialog, IE redirects to a
directory on the file system.

Does anyone know how to fix the redirect problem and/or the browser
incompatibility issue?

Thanks,
Will
matpol
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Parent Window is Redirecting after modal dialog closes


I don't think showModalDialog is part of Moz - I am pretty sure it's a
propritory IE thing.

Lee
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Parent Window is Redirecting after modal dialog closes


Foehammer said:[color=blue]
>
>I have the following snippet of code:
>
>function ShowTutorial(tutorialPath)
>{
> var ret = showModalDialog(tutorialPath, '',
> 'dialogWidth:' + screen.width + '; dialogHeight: ' + screen.height +
>'; '
> + 'resizable: no; help: no; status: no; scroll: no; '
> + 'dialogLeft:0; dialogTop:0;');
>
> return;
>
>}
>
>This function is called when an image is clicked. I intend for it to
>display a popup window with a flash file (I haven't created the flash
>files yet, so I am testing with a simple HTML document). The dialog
>pops up correctly in IE (but not in Firefox or any other REAL
>browser). However, when I close the dialog, IE redirects to a
>directory on the file system.
>
>Does anyone know how to fix the redirect problem and/or the browser
>incompatibility issue?[/color]

1. showModalDialog() is non-standard and not supported by Firefox.
Use window.open() if you need a new window.
2. I'm guessing that you're using the onclick event handler of a
link to invoke your function, and IE is waiting until after you
close the dialog to follow that link. Have your event handler
return false to prevent that:
onclick="ShowTutorial(...);return false"

Closed Thread