Я хочу открыть свою страницу ссылки в окне window.open. Я сохранил свой URL в одной переменной, и я передаю эту переменную в ссылку href ..
вот моя ссылка
<?php $linkvalue = "../mod/scorm/player.php?a=".$row->instance."¤torg=".$orgidentifier."&scoid=".$scoid."&sesskey=".$_SESSION['USER']->sesskey."&display=popup&mode=normal"; ?>
И я использовал так
<a class="btn btn-primary btn-xs" href="<?php echo $linkvalue; ?>">LAUNCH</a>
я хочу открыть ссылку выше, используя window.open
может кто-нибудь помочь мне, как это сделать ..
Заранее спасибо..
Я хочу открыть свою страницу ссылки в окне window.open. Я сохранил свой URL в одной переменной, и я передаю эту переменную в ссылку href ..
вот моя ссылка
<?php $linkvalue = "../mod/scorm/player.php?a=".$row->instance."¤torg=".$orgidentifier."&scoid=".$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>
Вы также можете установить целевой атрибут в ссылке на _blank, который откроет его в новом окне.
Вместо использования JavaScript (window.open
), будьте проще и используйте target
имущество.
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.
у меня есть решение
если мы будем использовать это, он будет работать .. он откроет ссылку в новом окне в той же таблице.
<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>