如何在弹出窗口中打开新选项卡? [英] how to open up a new tab in a pop-up?

查看:206
本文介绍了如何在弹出窗口中打开新选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你看,我对编程知之甚少,但我管理它,以某种方式使一个弹出窗口工作,但是,我需要在新窗口内(弹出窗口),它将会在弹出的按钮上打开一个新标签



但是我不需要在主浏览器中打开新标签页,我希望它在同一个流行版中打开

这可能吗?

我该怎么做?

好吧,我离开这两个弹出代码&现在,重定向代码正在将人员发送到我的Web浏览器中的另一个选项卡,但我需要在已打开的弹出窗口中执行此操作。



这里弹出代码

 <!DOCTYPE html> 
< html>
< body>

< p>点击收音机频道。< / p>

< button onclick =myFunction()>试试< / button>

< script>
函数myFunction()
{
window.open(http:// localhost:8000 / player / index.html);
}
< / script>

< / body>
< / html>

这里新选项卡的代码

 <!DOCTYPE html> 
< html>
< body>


< script type =text / javascriptsrc =http://hosted.musesradioplayer.com/mrp.js>< / script>
< script type =text / javascript>
MRP.insert(
'url':'localhost:8000 / stream',
'lang':'es',
'codec':'mp3',
'volume':65,
'autoplay':true,
'buffering':5,
'title':'Radio LineageChile',
'welcome': 'bienvenido a ...',
'bgcolor':'#FFFFFF',
'skin':'radiovoz',
'width':220,
'height' :69
});
< / script>


< / body>
< / html>

任何帮助都会大大减少

如果您有任何疑问,请询问

解决方案

要在同一个弹出窗口中打开新的URL,如下:

  var win = window.open(http:// localhost:8000 / player / index.html,' newwin','height = 200px,width = 200px'); 

运行此行后,新的弹出窗口将显示为height = 200px,width = 200px。
要在同一个popupwindown(win)中打开新的URL,请使用这一行

win.location = http://www.google.com /



您可以将Google网址替换为任何网址喜欢。



希望它有帮助!
祝你好运。
Johnny


You see, i don't know too much about programing, but i manage it to, somehow make a pop-up window work, however, i need inside that new window, (the pop-up one) it will be open a new tab from a button on the pop-up

But i don't need the new tab open in the main browser, i want it open in the same pop-up

is this possible?

how i can do it?

well, i leave both, the pop-up code & the redirection code who is, now, sending people just to another tab in my web browser, but i need to do it in the same pop-up window than is already open

Here the code in the pop-up

<!DOCTYPE html>
<html>
<body>

<p>Click aquí para escuchar Radio Lineage.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction()
{
window.open("http://localhost:8000/player/index.html");
}
</script>

</body>
</html>

Here the code of the new tab

<!DOCTYPE html>
<html>
<body>
.
.
<script type="text/javascript" src="http://hosted.musesradioplayer.com/mrp.js"></script>
<script type="text/javascript">
MRP.insert({
'url':'localhost:8000/stream',
'lang':'es',
'codec':'mp3',
'volume':65,
'autoplay':true,
'buffering':5,
'title':'Radio LineageChile',
'welcome':'Bienvenido a...',
'bgcolor':'#FFFFFF',
'skin':'radiovoz',
'width':220,
'height':69
});
</script>
.
.
</body>
</html>

Any help would be much apreciated

Please, ask if you have any doubt

解决方案

To open new URL in the same popup window, from your code, I edited to below:

var win = window.open("http://localhost:8000/player/index.html", 'newwin', 'height=200px,width=200px');

after run this line, new popup window will be showed with height=200px, width=200px. To open new URL in the same popup windown (win), use this line

win.location = "http://www.google.com"/

You can replace google URL by any URL you like.

Hope it helpful! Good luck. Johnny

这篇关于如何在弹出窗口中打开新选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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