[英]can't redirect new page in javascript?
can someone help me redirect to new page in javascript? 有人可以帮助我使用javascript重定向到新页面吗?
here is my code 这是我的代码
<p style=float:right;><font color="green"><a href="" onclick='return validate1();'>Delete</a></font></p>
function validate1()
{
var j1=0;
for(var i=0; i <document.Check.clickeduser.length;i++)
{
if(document.Check.clickeduser[i].checked)
{
if(j1==0)
{
total1 +=document.Check.clickeduser[i].value;
}
else
{
total1 +="|"+document.Check.clickeduser[i].value;
}
j1++;
}
}
if(total1=="")
{
alert("Select user to Delete");
return false;
}
else
{
var where_to= confirm("Do you really want to delete??");
if(where_to==true)
{
window.location = '<?php echo $redirect ?>locations.php?locationid='+total1;
}
else
{
total1="";
document.Check.checkall.checked = false;
//alert("alert");
for(var j=0; j<=document.Check.clickeduser.length;j++)
{
document.Check.clickeduser[j].checked = false;
}
}
return true;
}
}
here window.location = 'locations.php?locationid='+total1; 这里window.location ='locations.php?locationid ='+ total1; could n't redirect this link.
无法重定向此链接。
i don't know what's wrong please guide me 我不知道怎么了,请指导我
Thanks for advance 谢谢前进
Instead of this 代替这个
window.location = '<?php echo $redirect ?>locations.php?locationid='+total1;
Try this 尝试这个
window.location = 'locations.php?locationid='+total1; // why you need $redirect;
You can try this 你可以试试这个
//There was no ';' in <?php echo ?>
window.location = '<?php echo $redirect; ?>locations.php?locationid='+total1;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.