Parent Window is Redirecting after modal dialog closes

F

Foehammer

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
 
L

Lee

Foehammer said:
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?

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"
 
M

matpol

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top