473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Popup window code doesn't work

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

Jul 20 '05 #1
2 3955
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)
Jul 20 '05 #2


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

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
3
by: toufik toufik | last post by:
Hi, I'm using the folowing javascript code to oprn a popUp window msgWindow=window.open('','messageWindow', 'scrollbars=yes,width=300, height=150'); msgWindow.document.open();...
10
by: Thad | last post by:
Any javascript I could try on this? I've got a popup window on my site with the browser chrome removed. Another site's gone ahead and done a popup to my same .html page. The visitor to that site...
13
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related...
6
by: mkobus | last post by:
Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
5
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: ...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
3
by: Jimmy | last post by:
It is also possible for popup window to call function in main window by using the opener property. Will "opener.someFunctionInMain(param1, param2)" in the popup window work? It's possible for...
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.