AJAX PHP Loop After clicking on the status change picture
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"://Re-login
Location.replace (LOCATION.HREF);
Case "120"://Change Password
Location.replace (LOCATION.HREF);
Break
Default
Alert ("failure");
Location.replace (LOCATION.HREF);
Break
}
}
});
}
------------------------------------------------------------------------------
My problem is to call the Ajax after the direct replacement of the image does not need to refresh the page, the prawn help, online, etc.
------Solution--------------------
Don't know what you're going to do?
Since jquery is used, it's time to use the traditional jquery notation.
PHP section
"Name=" "
id="
"Name=" "
id="
JS section
$ (function () {
$ (". IMG"). Click (function () {
$ (this). Children (). Toggle ();
$.post ("!--? php echo base_url (' Test/fangfa ');?--",
{
N:math.random (),
Fn:escape ($ ( This). attr (' id ')),
Starflag:escape ($ (this). attr (' name ')
},
Function (msg) {
//You need Other processing
});
});