[Javascript] OPEN WINDOW TO EXACT SIZE

Andrew Dunn adunn at mail.interworx.com.au
Thu Jun 7 06:56:52 CDT 2001


Hi,
    I think the problem is when the body loads the image has not yet loaded?
I can't get it to work.

Regards,

Andrew
-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Rodney Myers
Sent: Thursday, 7 June 2001 7:46 PM
To: javascript at LaTech.edu
Subject: Re: [Javascript] OPEN WINDOW TO EXACT SIZE


PPK,
Very interesting that that is possible.

A small obstacle still to be got around I think.
If the URL sent to window open is myImage.jpg then there will be no body
tag.
The workaround would be to have an HTML file which included your body tag
and send the image file name as a query string attached to the URL of the
html page

"mypage.htm?myImage.jpg"

Then script in mypage.htm writes the image tag

document.write('<IMG src="',window.location.search.substring(1),'">');

If image names had non alpha characters (eg spaces [yuk]) then the code
would have to escape/unescape the image file name, I think.

Rodney

Peter-Paul Koch wrote:

  >     I am opening a pop up window that displays an image. I need the
window
  >to be the exact size of the image. Is there a way to do this without
  >knowing how big the image is going to be?
  In the popup:

  <BODY
  onLoad="if  (self.resizeTo)
  self.resizeTo(document.images[0].width,document.images[0].height"> (one
  line!)

  ppk


--
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/

Enquiries regarding Shop at ssistant Classic training :
Call 01256 880770

Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010607/f060d28f/attachment.htm>


More information about the Javascript mailing list