|
Posted by Jonathan N. Little on 11/24/25 11:28
Jackmac wrote:
> Hi all,
>
> Hopefully an easy one for someone.
>
> I'm trying to set up a link on my web pages which will allow me to open a
> new window of a specific size. Got that to work without a problem. The
> difficulty I have is that when you close the new window you've opened,
> instead of having the page you cliked from, you see a page with... [object]
> on it.
>
> The page concerned is:
>
> http://www.independentproducts.co.uk/test.htm
>
> Any ideas anyone please?
>
> TIA
>
> Jackmac
>
>
That's because window.open() return a reference to the new window which
to put in the href of the link.
<a href="javascript:foobar();">
is a bad idea, what happens if the user has javascript disabled?
better:
JavaScript:
function popup(url){
var newwin=window.open(url,'bob','WIDTH=320,HEIGHT=195');
return false; //so if javascript IS enabled prevents link on page
}
HTML:
<a href='http://www.wedgwood-group.com/'
onclick="return popup('http://www.wedgwood-group.com/')">
Click to download
</a>
If user has javascript disabled then the your download will be in main
window, else in the popup.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
[Back to original message]
|