Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Popup window code doesn't work

Reply
Thread Tools

Popup window code doesn't work

 
 
Mika
Guest
Posts: n/a
 
      07-05-2003
Hi,

I'm trying to use the following code which should open a popup window.
It doesn't work with Opera 5. Netscape 4.x opens a window in wrong size.
IE 5.5, Netscape 7.0 and Opera 7.11 are ok.

First of all, I have this HTML code:

<a href="image.gif" target="_blank" onclick="screenshot('image.gif', 'My
Title', '741', '492'); return false;"><img src="image.jpg"></a>

Plese note that the size of image.gif is 741 x 492 pixels.

And here is my JavaScript function:

function screenshot(filename, wintitle, winwidth, winheight)
{
content = '<html><head><title>' + wintitle + '</title></head>';
content += '<body leftmargin="0" rightmargin="0" topmargin="0"
bottommargin="0" marginwidth="0" marginheight="0" style="margin: 0px;
padding: 0px">';
content += '<img src="' + filename + '" alt="' + wintitle + '"
onclick="window.close();">';
content += '</body></html>';

body = window.open('', 'content', 'toolbar=0, menubar=0, location=0,
status=0, width=' + winwidth + ', height=' + winheight + ', resizable=1,
scrollbars=0, screenY=5, top=5');
body.document.write(content);
body.document.close();
}

What should I do with these?

Thanks a lot,
Mika

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      07-05-2003
Mika wrote on 05 jul 2003 in comp.lang.javascript:
> body.document.write


document.body.write ??

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Richard L. Trethewey
Guest
Posts: n/a
 
      07-06-2003


Mika wrote:
> Hi,
>
> body = window.open('', 'content', 'toolbar=0, menubar=0, location=0,
> status=0, width=' + winwidth + ', height=' + winheight + ', resizable=1,
> scrollbars=0, screenY=5, top=5');


Remove the spaces between the parameters in the window attributes (a.k.a.
"chroma") section. NS4 and other browsers will fail if this area has spaces.
Good luck!

Richard L. Trethewey

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Initiating a PostBack on a main window from a popup window Jay ASP .Net 8 06-12-2011 10:51 AM
Popup Window Popup Timing =?Utf-8?B?Sm9obiBXYWxrZXI=?= ASP .Net 3 11-04-2005 07:33 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Popup window to raise event in parent window...can it be done??? Earl Teigrob ASP .Net 4 06-04-2004 11:47 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57