Click here to Skip to main content
13,549,847 members
Rate this:
Please Sign up or sign in to vote.
See more:
How to open the page in new window by using the only html code.I have written the code like this
<A style="COLOR: #000080; TEXT-DECORATION: underline" href="/A/B/web/images/abc.pdf" target=_blank>ABC</A>

But its opening the page in new tab.I dont want like that.The page has to open in new window.Can anyone help regarding this?
Posted 3-Jan-13 5:27am
rahkan 3-Jan-13 11:31am
If I remember correctly that is a browser setting, whether it opens in a tab or a new window will depend on how the users have their browser configured
priya9826 3-Jan-13 11:32am
How to configure the browser to open the page in new window?
rahkan 3-Jan-13 12:10pm
depends on what browser you're using, but it should be under options somewhere
priya9826 3-Jan-13 12:51pm
Sorry..I am using IE9
priya9826 3-Jan-13 12:52pm
Sorry.I am using IE9
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

As far as I know there is no way to do this using "target" property.

you may have to use following way

<script type="text/javascript">
	function pop_up(hlink, wname)
		if (! window.focus)
			return true;
		var href;
		if (typeof(hlink) == 'string')
			'width=400,height=200,toolbar=no, scrollbars=yes'
		return false;
	<a style="COLOR: #000080; TEXT-DECORATION: underline" href="/A/B/web/images/abc.pdf" onclick="return popup(this, 'color pop up')">ABC</a></script>
priya9826 3-Jan-13 12:48pm
The above piece of code opens the page in new window in another project.If I copy the same code in to my application.It doesnt works for me.Do I need to add anything for this?
tharakamtr 3-Jan-13 13:47pm
no you no need to add anything for this.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Use Javascript."url") will help to open new window. But sometimes browser will not allow to open pop up windows for stop advertisements via pop up windows,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180515.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100