Home >Backend Development >PHP Tutorial > AJAX PHP 循环以后点击状态更换图片
AJAX PHP 循环之后点击状态更换图片
foreach ( $account as $key => $value)
{
?>
');">
}
else{
?>
');">
function xingxing(id,name){
$.ajax({
type: "POST",
url: "",
processData: "false",
data: "n=" + Math.random() + "&fn=" + escape(id) + "&starflag=" + escape(name) + "",
success: function(msg){
var msg = $.trim(msg);
switch (msg){
case "200":
location.replace(location.href);
case "110": //重新登录
location.replace(location.href);
case "120": //修改密码
location.replace(location.href);
break;
default:
alert("失败");
location.replace(location.href);
break;
}
}
});
}
------------------------------------------------------------------------------
我的问题是 调用AJAX 之后直接更换图片不需要在从新刷新一次页面,求大虾帮忙,在线等