【问题标题】:Javascript Redirect Out Of Iframe Javascript/PHPJavascript 重定向出 iframe Javascript/PHP
【发布时间】:2015-04-09 16:52:34
【问题描述】:

我试图研究它,但我认为我的语法可能有问题。下面是尝试的代码。我需要做的是从 iframe 重定向到同一域上的另一个页面。标头:位置仅重定向 iframe,我需要重定向整个页面。从我读过的其他帖子中,这不能通过 PHP 完成,而是需要 javascript。这就是我现在直接在 PHP 中所拥有的。提前致谢。

//header("Location: http://propertytaxdfw.com/CurrentWebsite/error.php?msg=".$httpParsedResponseAr['L_LONGMESSAGE0']);
                $ErrorUrl = 'http://propertytaxdfw.com/CurrentWebsite/error.php?msg=".$httpParsedResponseAr['L_LONGMESSAGE0']';
                <script type="text/javascript">parent.location = '<?php echo $ErrorUrl?>';</script>

【问题讨论】:

  • 你没有添加&lt;?php和?&gt;标签。

标签: javascript php iframe


【解决方案1】:

你试过parent.location吗?

<?php
$ErrorUrl = 'http://propertytaxdfw.com/CurrentWebsite/error.php';
?>

<script type="text/javascript">parent.location = '<?php echo $ErrorUrl?>';</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-27
    • 2015-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-09
    相关资源
    最近更新 更多