Home > Backend Development > PHP Tutorial > AJAX PHP 循环以后点击状态更换图片

AJAX PHP 循环以后点击状态更换图片

WBOY
Release: 2016-06-13 12:32:52
Original
732 people have browsed it

AJAX PHP 循环之后点击状态更换图片
                    foreach ( $account as $key => $value)
         {
    ?> 
 
          
        ');">
           AJAX PHP 循环以后点击状态更换图片  
        

                   }
        else{
        ?>
        ');">
           AJAX PHP 循环以后点击状态更换图片  
        

            
        



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
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template