我正在尝试在我的 php 脚本中调用 javascript 确认对话框,这似乎不起作用,我做错了什么,是更好的方法吗,这是代码示例:
<?php
echo "<script language=\"javascript\">";
echo "var answer = confirm(\"Are you sure you want to delete this Buyer?\")";
echo "if (answer !=0) { ";
$g->DelBuyer($reg);
echo "}else{";
echo" You preesed cancel";
echo "}";
echo "</script>";
enter code here