html在新的目标和焦点上打开一个网址 [英] html open a url on new target and focus

查看:83
本文介绍了html在新的目标和焦点上打开一个网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



它通过在一个新窗口/选项卡中打开帮助页面< a href = ...target =help> (没有其他的框架有这个名字)



这首次打开新窗口/标签,寻求帮助。
但是在随后的点击中,窗口/标签被加载但仍然隐藏。



我试过这个:

 <脚本> 
函数OpenAndFocusHelp(){
win = window.open('help / 1000CH00017.htm','help');
win.focus();
}
< / script>

< a href =help.htmltarget =help
onclick =OpenAndFocusHelp()>帮助< / a>

它没用!

解决方案

我认为这个功能是特定于浏览器的,你不能定义聚焦新标签或窗口的行为。


I am trying to fix a web site.

It opens a help page in a new window/tab via <a href="..." target="help"> (no other frame has this name)

This works well the first time opening a new window/tab, for the help. But on subsequent clicks the window/tab is loaded but remains hidden.

I tried this:

<script>
    function OpenAndFocusHelp() {
        win=window.open('help/1000CH00017.htm','help');
        win.focus();
    }      
</script>

<a href="help.html" target="help" 
   onclick="OpenAndFocusHelp()">Help</a>

It did not work!

解决方案

I think this feature is browser-specific and you can't define the behavior for focusing new tabs or windows..

这篇关于html在新的目标和焦点上打开一个网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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