JavaScript Eval 函数使用


      $.ajax
      (
      {
        type: "POST", 
        contentType: "application/json",
        url: serviceURL+"/UserLogin",
        data: "{UserLoginID:'"+$('#txtLoginID').val()+"',UserLoginPW:'"+$('#txtLoginPW').val()+"'}",      
        dataType: 'json',
        success: function(result)
        {
         var user = eval(result.d);
         //eval("user="+result.d);
          location.href = "Welcome.aspx?userID="+user.UserID
        },
        error: function(result, status)
        {
        if(status == 'timeout')
        {
        alert("The request timed out, please resubmit");
        }
        else
        {
        eval("exception = "+result.responseText);
        //var exception = eval(result.responseText);
            alert(exception.Message);
          }
        }
      }
      );

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdsdxs.html