Javascript 要在php中的window.open页面中打开链接url吗

Javascript 要在php中的window.open页面中打开链接url吗,javascript,php,Javascript,Php,我想在window.open page中打开我的链接页。我将url保存在一个变量中,并将该变量传递到href link中 这是我的链接 <?php $linkvalue = "../mod/scorm/player.php?a=".$row->instance."&currentorg=".$orgidentifier."&scoi‌​d=".$scoid."&sesskey=".$_SESSION['USER']->sesskey."&disp

我想在window.open page中打开我的链接页。我将url保存在一个变量中,并将该变量传递到href link中

这是我的链接

<?php $linkvalue = "../mod/scorm/player.php?a=".$row->instance."&currentorg=".$orgidentifier."&scoi‌​d=".$scoid."&sesskey=".$_SESSION['USER']->sesskey."&display=popup&mode=normal"; ?>

我以前也是这样

<a class="btn btn-primary btn-xs" href="<?php echo $linkvalue; ?>">LAUNCH</a>

我想用window.open打开上面的链接

有人能帮我怎么做吗

提前感谢..

这应该可以做到:

<a class="btn btn-primary btn-xs" href="javascript:window.open('<?php echo $linkvalue; ?>');">LAUNCH</a>


您还可以将链接上的target属性设置为_blank,这将在新窗口中打开它。

而不是使用JavaScript(
window.open
),保持简单并使用该属性

target
    Specifies where to display the linked URL. It is a name of, or keyword for, a browsing context: a tab, window, or <iframe>. The following keywords have special meanings:

    _self: Load the URL into the same browsing context as the current one. This is the default behavior.
    _blank: Load the URL into a new browsing context. This is usually a tab, but users can configure browsers to use new windows instead.
    _parent: Load the URL into the parent browsing context of the current one. If there is no parent, this behaves the same way as _self.
    _top: Load the URL into the top-level browsing context (that is, the "highest" browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this behaves the same way as _self.
目标
指定显示链接URL的位置。它是浏览上下文的名称或关键字:选项卡、窗口或。以下关键词具有特殊含义:
_self:将URL加载到与当前URL相同的浏览上下文中。这是默认行为。
_空白:将URL加载到新的浏览上下文中。这通常是一个选项卡,但用户可以将浏览器配置为使用新窗口。
_父:将URL加载到当前URL的父浏览上下文中。如果没有父对象,则其行为方式与\u self相同。
_top:将URL加载到顶级浏览上下文(即“最高”的浏览上下文,它是当前URL的祖先,并且没有父级)。如果没有父对象,则其行为方式与\u self相同。
我找到了解决方案

如果我们像这样使用,它将工作..它将在sametab中的新窗口上打开链接

<a class="btn btn-primary btn-xs" onclick="window.open('<?php echo $linkvalue; ?>', 'mywindow', 'location=0,status=0,scrollbars=0,width=1000,height=600');">LAUNCH</a> 

不,我不想在新窗口中打开..我想在同一选项卡上打开新窗口..就像popup@user200然后你需要看一个JS解决方案,它允许你在模态窗口中加载iFrame。@user200这看起来是一个很好的起点:@user200然后你需要把你的问题弄清楚,正如它所述,您希望使用已提供的window.open。如果你还需要其他东西,你需要解释一下原始帖子中的内容。我尝试了所有4个…但它仍然显示了新的链接window@user200是的,这正是您在问题中要求的,您提到了
window.open
,这就是
window.open
的作用。澄清你的问题。我很难理解确切的要求(即使在阅读了评论之后)