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 之後直接更換圖片不需要在從新重新整理一次頁面,求大蝦幫忙,線上等 ajax php javascript
分享到:
------解決方案--------------------
不知道你要做什嗎?
既然是用了 jquery,那麼就該用 jquery 的傳統寫法
php 部分
" name="" id="" />
" name="" id="" />
js 部分
$(function() {
$(".img").click(function() {
$(this).children().toggle();
$.post("",