显示jQuery的$就503错误响应错误、jQuery

由网友(梦想的天空分外蓝)分享简介:我想显示有503错误响应文件的响应。函数netbootupdate(){$(#netbootstatus)HTML(更新..')。$阿贾克斯({键入:GET,网址:clientarea.php,数据:'行动=产品详细和ID ='+ $('#服务器ID)VAL()+'&放大器; modop =定制和放大器; A = ne...

我想显示有503错误响应文件的响应。

 函数netbootupdate(){


$(#netbootstatus)HTML(更新..')。
  $阿贾克斯({
    键入:GET,
    网址:clientarea.php,
    数据:'行动=产品详细和ID ='+ $('#服务器ID)VAL()+'&放大器; modop =定制和放大器; A = netbootset和放大器; netbootid ='+ $('#netbootid)VAL()+。 '和;根='+ $('#根)VAL()
    超时:5000,
    成功:功能(数据){
      $(#netbootstatus)的HTML(数据);
      $(#状态)HTML('')。
    },
    错误:功能(数据){
      $(#状态)HTML(数据);
      $('#状态')addClass('errorbox')。
    }
    });
}
 

出于某种原因,数据并没有给我回复的内容。

解决方案

  $。阿贾克斯({
   // ...
   // [其他参数]
   // ...
   错误:函数(xmlReq,txtStatus,errThrown){
     $('#状态)文本(xmlReq.responseText).addClass('errorBox');
   }
});
 

我认为这就是你要的是什么,但不能肯定。无论哪种方式, xmlReq (因为我已经把它命名为)拥有的若干属性的与之相关的,您可以访问和参考。

AE CS4重装出现错误,运行无响应

I'm trying to display the response of a file that responds with an 503 error.

function netbootupdate() {


$("#netbootstatus").html('Updating..'); 
  $.ajax({
    type: 'GET',
    url: 'clientarea.php',
    data: 'action=productdetails&id=' + $('#serverid').val() + '&modop=custom&a=netbootset&netbootid=' + $('#netbootid').val() + '&root=' + $('#root').val(),
    timeout: 5000,
    success: function(data) {
      $("#netbootstatus").html(data);
      $("#status").html(''); 
    },
    error: function(data) {
      $("#status").html(data);
      $('#status').addClass('errorbox');
    }
    });
}

For some reason data doesn't give me the content of the reply.

解决方案

$.ajax({
   // ...
   // [other arguments]
   // ...
   error: function(xmlReq, txtStatus, errThrown){
     $('#status').text(xmlReq.responseText).addClass('errorBox');
   }
});

I think that's what you're going for, though not sure. Either way, the xmlReq (as I've named it) has several properties associated with it you can access and reference.

阅读全文

相关推荐

最新文章