Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML
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
Comments
rahkan at 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 at 3-Jan-13 11:32am
   
How to configure the browser to open the page in new window?
rahkan at 3-Jan-13 12:10pm
   
depends on what browser you're using, but it should be under options somewhere
priya9826 at 3-Jan-13 12:51pm
   
Sorry..I am using IE9
priya9826 at 3-Jan-13 12:52pm
   
Sorry.I am using IE9
Rate this: bad
good
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')
			href=hlink;
		else
			href=hlink.href;
		window.open(
			href,
			wname,
			'width=400,height=200,toolbar=no, scrollbars=yes'
		);
		return false;
	}
	</script>
	<a style="COLOR: #000080; TEXT-DECORATION: underline" href="/A/B/web/images/abc.pdf" onclick="return popup(this, 'color pop up')">ABC</a></script>
  Permalink  
Comments
priya9826 at 3-Jan-13 12:48pm
   
T3
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?
Tharaka MTR at 3-Jan-13 13:47pm
   
no you no need to add anything for this.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Use Javascript. window.open("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,
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
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