我在CEWP(内容编辑器webpart)中使用以下代码,因此在接受调查后,用户将被重定向到感谢页面。重定向不起作用。我错过了什么吗? (用户能够调查并且newform.aspx永不结束)JavaScript to add source URL
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
function PreSaveAction(){
var URL = location.pathname.replace("NewForm.aspx","/surveys/Pages/ThankYou.aspx");
if(GetUrlKeyValue("IsDlg")==="1"){
URL+="?IsDlg=1";
}
$("#aspnetForm").attr("action",location.pathname+"?Source="+URL);
return true;
}
</script>
尽量把警告框,看看你得到 –
我在返回true之前添加警报;并警惕起来。 –
尝试将url变量设置后的警告框,看看你的URL变量 –