Connecting Tech Pros Worldwide Help | Site Map

Parent Window is Redirecting after modal dialog closes

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 07:05 PM
Foehammer
Guest
 
Posts: n/a
Default Parent Window is Redirecting after modal dialog closes

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

  #2  
Old July 23rd, 2005, 07:05 PM
matpol
Guest
 
Posts: n/a
Default 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.

  #3  
Old July 23rd, 2005, 07:05 PM
Lee
Guest
 
Posts: n/a
Default 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"

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.