使用html在新窗口中打开页面 [英] Open the page in new window using html

查看:79
本文介绍了使用html在新窗口中打开页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用唯一的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>





但它在新标签页面中打开页面。我不想那样。页面必须在新的wi中打开ndow.Can任何人可以帮忙解决这个问题吗?



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?

推荐答案

据我所知,使用target属性无法做到这一点。



您可能需要使用以下方式



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>


使用Javascript。 window.open(url)将有助于打开新窗口。但有时浏览器不允许通过弹出窗口打开弹出窗口停止播放广告,
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,


这篇关于使用html在新窗口中打开页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆