Test If I click the T...">

How to make a hyperlink open as a popup with a given width and height?

I have a hyperlink that:

<a href="some.html">Test</a> 

If I click the Test link, some.html should open as a popup menu with a given width and height.

How can i do this?

+4
source share
5 answers

Using target='_blank' sometimes opens in a new tab, and this is usually done for Firefox and Chrome. Best to use the Frédéric code:

 <a href="javascript:window.open('some.html', 'yourWindowName', 'width=200,height=150');">Test</a> 
+1
source

You can use window.open () :

 <a href="javascript:window.open('some.html', 'yourWindowName', 'width=200,height=150');">Test</a> 

Or:

 <a href="#" onclick="window.open('some.html', 'yourWindowName', 'width=200,height=150');">Test</a> 
+8
source

To open a popup, you can use target="_blank" :

 <a href="some.html" target="_blank">Test</a> 

Or use window.open :

 <a href="#" onclick="window.open('some.html', 'win', 'width=400,height="400"')">Test</a> 
+2
source

an easy way to implement without a snap element and without a new popup panel

 <span class="popup" onClick="javascript:window.open('http://www.google.com', '_blank','toolbar=no,width=250,height=250');"> 
+1
source

Try using this code:

 <a href="javascript: void(0)" onclick="window.open('yourLink','_blank','width=900,height=300');">Try</a> 

Using javascript: void(0) so as not to touch the previous page after clicking the popup.

+1
source

All Articles