[Javascript] OPEN WINDOW TO EXACT SIZE

Rodney Myers rodney at aflyingstart.net
Thu Jun 7 04:45:53 CDT 2001


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/2a44efc1/attachment.htm>


More information about the Javascript mailing list