com.google.gwt.xhr.client.XMLHttpRequest.getReadyState()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中com.google.gwt.xhr.client.XMLHttpRequest.getReadyState()方法的一些代码示例,展示了XMLHttpRequest.getReadyState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLHttpRequest.getReadyState()方法的具体详情如下:
包路径:com.google.gwt.xhr.client.XMLHttpRequest
类名称:XMLHttpRequest
方法名:getReadyState

XMLHttpRequest.getReadyState介绍

[英]Get's the current ready-state.

See http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-state.
[中]这是当前的就绪状态。
http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-state

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        listener.onSuccess(xhr.getResponseText());
      }
    }
  }
});

代码示例来源:origin: libgdx/libgdx

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        listener.onSuccess(xhr.getResponseText());
      }
    }
  }
});

代码示例来源:origin: libgdx/libgdx

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
        listener.onSuccess(new Blob(data));
      }
    }
  }
});

代码示例来源:origin: libgdx/libgdx

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
        listener.onSuccess(new Blob(data));
      }
    }
  }
});

代码示例来源:origin: com.google.gwt/gwt-servlet

protected boolean isResponseReady() {
  return xmlHttpRequest.getReadyState() == XMLHttpRequest.DONE;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Returns true if this request is waiting for a response.
 * 
 * @return true if this request is waiting for a response
 */
public boolean isPending() {
 if (xmlHttpRequest == null) {
  return false;
 }
 int readyState = xmlHttpRequest.getReadyState();
 /*
  * Because we are doing asynchronous requests it is possible that we can
  * call XmlHttpRequest.send and still have the XmlHttpRequest.getReadyState
  * method return the state as XmlHttpRequest.OPEN. That is why we include
  * open although it is nottechnically true since open implies that the
  * request has not been sent.
  */
 switch (readyState) {
  case XMLHttpRequest.OPENED:
  case XMLHttpRequest.HEADERS_RECEIVED:
  case XMLHttpRequest.LOADING:
   return true;
 }
 return false;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

public void onReadyStateChange(XMLHttpRequest xhr) {
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
   xhr.clearOnReadyStateChange();
   request.fireOnResponseReceived(callback);
  }
 }
});

代码示例来源:origin: net.wetheinter/gwt-user

protected boolean isResponseReady() {
  return xmlHttpRequest.getReadyState() == XMLHttpRequest.DONE;
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

protected boolean isResponseReady() {
  return xmlHttpRequest.getReadyState() == XMLHttpRequest.DONE;
 }
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

public void onReadyStateChange(XMLHttpRequest xhr) {
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
   xhr.clearOnReadyStateChange();
   fireOnResponseReceivedVltr(request, PromiseReqBuilder.this);
  }
 }
});

代码示例来源:origin: org.atmosphere/atmosphere-gwt-client

@Override
  public void run() {
    r.clearOnReadyStateChange();
    if (r.getReadyState() != XMLHttpRequest.DONE
        && r.getReadyState() != XMLHttpRequest.UNSENT) {
      listener.onDisconnected();
      r.abort();
    }
    r = null;
  }
}.schedule(5000);

代码示例来源:origin: com.vaadin.external.atmosphere/atmosphere-gwt-client

@Override
  public void run() {
    r.clearOnReadyStateChange();
    if (r.getReadyState() != XMLHttpRequest.DONE
        && r.getReadyState() != XMLHttpRequest.UNSENT) {
      listener.onDisconnected();
      r.abort();
    }
    r = null;
  }
}.schedule(5000);

代码示例来源:origin: net.wetheinter/gwt-user

public void onReadyStateChange(XMLHttpRequest xhr) {
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
   xhr.clearOnReadyStateChange();
   request.fireOnResponseReceived(callback);
  }
 }
});

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

public void onReadyStateChange(XMLHttpRequest xhr) {
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
   xhr.clearOnReadyStateChange();
   request.fireOnResponseReceived(callback);
  }
 }
});

代码示例来源:origin: io.reinert.requestor.core/requestor-api

public void onReadyStateChange(com.google.gwt.xhr.client.XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      xhr.clearOnReadyStateChange();
      ((XMLHttpRequest) xhr).clearOnProgress();
      gwtRequest.fireOnResponseReceived(callback);
    }
  }
});

代码示例来源:origin: reinert/requestor

public void onReadyStateChange(com.google.gwt.xhr.client.XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      xhr.clearOnReadyStateChange();
      ((XMLHttpRequest) xhr).clearOnProgress();
      gwtRequest.fireOnResponseReceived(callback);
    }
  }
});

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        listener.onSuccess(xhr.getResponseText());
      }
    }
  }
});

代码示例来源:origin: thothbot/parallax

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        listener.onSuccess(xhr.getResponseText());
      }
    }
  }
});

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
        listener.onSuccess(new Blob(data));
      }
    }
  }
});

代码示例来源:origin: thothbot/parallax

@Override
  public void onReadyStateChange (XMLHttpRequest xhr) {
    if (xhr.getReadyState() == XMLHttpRequest.DONE) {
      if (xhr.getStatus() != 200) {
        listener.onFailure();
      } else {
        Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
        listener.onSuccess(new Blob(data));
      }
    }
  }
});

相关文章