AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



html-javascript: How to open a link in a new window?

I want to open a link in separate window. Please help me.

html x 24
javascript x 33
Posted On : 2013-12-14 20:08:00.0
profile Garima Gupta - anyforum.in Garima Gupta
596129560202
up-rate
5
down-rate

Answers


If you want to open a separate tab or window of same size use target="_blank". It´s attribute of the html tag <a>. and if you want to customize the window you can do it by javascript:
window.open("url","name","width=400,height=350");
Let´s see the simple example:

New Window.html:
----------------------------
<a href="http://www.anyfourm.in" target="_blank">Open new tab</a><br/>
<a href="#" onclick="opennew()">Open new window Or popup</a>
<script type="text/javascript">
function opennew(){
popupWindow=window.open("http://www.anyforum.in","name","width=400,height=350");
popupWindow.focus();
}
</script>

**************************************** Output ****************************************

Open new tab
Open new window Or popup

Posted On : 2013-12-14 20:52:24
Satisfied : 1 Yes  0 No
profile Saksham Kumar - anyforum.in Saksham Kumar
73433939909
Reply This Thread
up-rate
5
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in