我正在Yii
的网站上工作。情况就是这样。在网站中,users
提供了一段代码,如下所示:
<iframe height="700" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="http://djoneclick.com/index.php?r=webservice/form&id=6b720ff1c3cdce6c278e784a3228fd9fadc6d864" title="" >
<a href="/index.php?r=webservice/form&id=6b720ff1c3cdce6c278e784a3228fd9fadc6d864" title="">
</a>
</iframe>
User
可以将其嵌入到他们想要的任何地方,并从所需的受众群体中进行查询。此iframe
包含src
form
,controller
提交Yii
中的controller
。在if
中,在具有特定true
条件redirects
时,它url
到外部url
。它会重定向,但iframe
(重定向到的内容)的内容会显示在redirect
中。我想要的是实际url
到R&D
。
我花了几个小时*
为此但找不到任何解决方案。有什么帮助吗?
答案 0 :(得分:1)
$("#idForm").submit(function() {
var url = "path/to/your/script.php"; // the script where you handle the form input.
$.ajax({
type: "POST",
url: url,
data: $("#idForm").serialize(), // serializes the form's elements.
success: function(data)
{
window.top.location.href = "http://www.yoursite.com";
}
});
return false; // avoid to execute the actual submit of the form.
});
答案 1 :(得分:1)
在controller
echo "<script>";
echo "this.parent.location.href = '$externel_url'";
echo "</script>";