PDA

View Full Version : javascript:opener and Mozilla


vgonzalez
11-05-2003, 11:17 PM
Hello,

I have a javascript popup window that works great in IE, (thanks to some help from 'adios') but it doesn't work in Mozilla. To clarify, in mozilla the pop up and text show up fine, but the image is not displayed.

What I am doing wrong?
Thanks!
~Vicky


The function showDiskToRemove() is called from another javascript.


var HTML, picwin = null;
var picURL = '/Overland/Images/disk';

function showDiskToRemove( diskToRemove )
{
var picImage = picURL + diskToRemove + ".gif" ;

if (picwin && ! picwin.closed)
{
picwin.close();
}
HTML = '';
HTML += '<html><head><title>Remove Proper Disk<';
HTML += '/title><';
HTML += '/head><body align=center TEXT="#440D51" BGCOLOR="#EEEDCB" >';
HTML += '<br><p align=center><img src="' + picImage + '">';
HTML += '<br><font color="#440D51" face="century gothic, century schoolbook, arial">';
HTML += '<br>Please Remove the disk indicated in the picture above.<br><br>';
HTML += '<strong>Removing any other disk could result in data loss!<';
HTML += '/strong><br><';
HTML += '/p><';
HTML += '/font><p align=center><form style="margin:12px auto;">';
HTML += '&nbsp;<input type="button" class="OverlandButton" value="OK" onclick="self.close()"><';
HTML += '/form><br><';
HTML += '/p><br><';
HTML += '/body><';
HTML += '/html>';

picwin = open('javascript:opener.HTML', 'picwin', 'left=160,top=160,width=450,height=275,status=0');

if (picwin && ! picwin.closed)
{
picwin.focus();
}
return false;
}

adios
11-06-2003, 04:29 AM
Try giving the image a fully-qualified url:

var picURL = 'http://www.somedomain/Overland/Images/disk';

Remember, it's being loaded into a new window...;)

vgonzalez
11-06-2003, 05:51 PM
Thank you adios again, I got bit by IE working fine with partial info. :)

One more question, is there a way to pass the full path of the parent window to this new popup window? You see the address can be set to ips - we dont't support DNS at this time.

Thanks,
~vgonzalez

adios
11-06-2003, 05:56 PM
http://caucuscare.com/~roth/JAVASCRIPT/refp_208.htm :cool:

vgonzalez
11-06-2003, 07:03 PM
Many thanks adios, everything works great!

Thanks for the URL, a must bookmark.
~vgonzalez