[Javascript] Quick question on passing reference to url
David Chance
david_chance at yahoo.com.au
Wed Nov 29 12:30:41 CST 2006
thanks for the reply.
What I'm looking to do is basically just have an image
displayed, then when clicking on it a new window opens that I
can size and include a close link in it.
<SCRIPT language="JavaScript" type="text/javascript">
<!-- ;
var newwindow = ''
function ImageWindow(url) {
if (newwindow.location && !newwindow.closed) {
newwindow.location.href = url;
newwindow.focus(); }
else {
var generator=window.open('','name','height=400,width=500');
generator.document.write('<html><head><title>Popup</title>');
generator.document.write('<A
HREF="javascript:ImageWindow(ImgUrl)"><IMG SRC='ImgUrl'
width="300">');
generator.document.write('<p>Image Window</p>');
generator.document.write('<p><a
href="javascript:self.close()">
Close</a> the popup.</p>');
generator.document.write('</body></html>');
generator.document.close();
}
}
function tidy() {
if (newwindow.location && !newwindow.closed) {
newwindow.close(); }
}
//-->
</SCRIPT>
--- Flávio Gomes <flavio at economisa.com.br> wrote:
> Can you post the code to the "ImageWindow" function?
>
>
>
> Nathan V. Patwardhan escreveu:
>
> >On Thu, Nov 30, 2006 at 04:53:54AM +1100, David Chance wrote:
> >:
> >: <script>
> >:
> >: var ImgUrl="http://mysite.verizon.net/stove1.jpg"
> >: </script>
> >:
> >: <A HREF="javascript:ImageWindow(ImgUrl)"><IMG
> SRC='ImgUrl' width="300"></A>
> >
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> >Unless I'm missing something, this isn't Javascript. It's
> just HTML.
> >
> >
> >
>
> --
> Flavio Gomes
> flavio at economisa.com.br
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
Send instant messages to your online friends http://au.messenger.yahoo.com
More information about the Javascript
mailing list