目的是想在PHP网页里加入confirm提示框。我的代码如下:
<?php
echo"<script>var result=confirm('你的修改无效!请重新修改');return result;</script>";
if( result==false)
header("location: display.php");
else
header("location: modify.php");
?>
运行后没有出来提示框,想问一下语法哪里有错误
<?php
echo"<script>var result=confirm('你的修改无效!请重新修改');return result;</script>";
if( result==false)
header("location: display.php");
else
header("location: modify.php");
?>
运行后没有出来提示框,想问一下语法哪里有错误
echo "<script>if(confirm('你的修改无效!请重新修改'){ window.lacation='modify.php';}else{window.location='display.php';}</script>";
window.location.href='display.php';
} else {
window.location.href='modify.php';
}
</script>
两个php文件写反了 自己换下位置...咔咔
推荐JS的经典入门书《DOM编程艺术 第二版》,去系统学习一下吧,花个一两礼拜时间。