/**
* Fires a request to a JSONP-supporting URL.
*/
public void request(String url, final Callback<? super R> request) {
final String id = JSONP_HANDLER_PREFIX + jsonpCounter++;
final ScriptElement requestMaker = Document.get().createScriptElement();
registerCallback(id, new Callback<JavaScriptObject>() {
@Override
public void onSuccess(JavaScriptObject cajoled) {
requestMaker.removeFromParent();
deregisterCallback(id);
request.onSuccess(cajoled.<R>cast());
}
@Override
public void onError(String message) {
// Ignore
}
});
requestMaker.setSrc(url + "&" + JSONP_CALLBACK_PARAM + "=" + id);
Document.get().getBody().appendChild(requestMaker);
}