import com.google.gwt.query.client.GQ;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Promise;
-import com.google.gwt.query.client.Properties;
import com.google.gwt.query.client.builders.JsonBuilder;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.query.client.plugins.Plugin;
}
});
- public static Promise ajax(Properties p) {
+ public static Promise ajax(Binder p) {
Settings s = createSettings();
s.load(p);
return ajax(s);
return ajax(s);
}
- public static Promise ajax(String url, Properties p) {
+ public static Promise ajax(String url, Binder p) {
Settings s = createSettings();
s.load(p);
s.setUrl(url);
return s;
}
- public static Promise get(String url, Properties data, Function onSuccess) {
+ public static Promise get(String url) {
+ return get(url, null, null);
+ }
+
+ public static Promise get(String url, Binder data) {
+ return get(url, data, null);
+ }
+
+ public static Promise get(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("txt");
return ajax(s);
}
- public static Promise getJSON(String url, Properties data, Function onSuccess) {
+ public static Promise getJSON(String url, Binder data) {
+ return getJSON(url, data, null);
+ }
+
+ public static Promise getJSON(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("json");
s.setSuccess(onSuccess);
return ajax(s);
}
-
+
public static Promise getJSONP(String url) {
return getJSONP(url, null, null);
}
- public static Promise getJSONP(String url, Properties data, Function onSuccess) {
+ public static Promise getJSONP(String url, Binder data) {
+ return getJSONP(url, data, null);
+ }
+
+ public static Promise getJSONP(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("jsonp");
.setSuccess(success)
);
}
-
- public static Promise post(String url, Properties data) {
+
+ public static Promise post(String url, Binder data) {
return post(url, data, null);
}
-
- public static Promise post(String url, Properties data, final Function onSuccess) {
+
+ public static Promise post(String url, Binder data, final Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("txt");
super(gq);
}
- public Ajax load(String url, Properties data) {
+ public Ajax load(String url, Binder data) {
return load(url, data);
}
- public Ajax load(String url, Properties data, final Function onSuccess) {
+ public Ajax load(String url, Binder data, final Function onSuccess) {
Settings s = createSettings();
final String filter = url.contains(" ") ? url.replaceFirst("^[^\\s]+\\s+", "") : "";
s.setUrl(url.replaceAll("\\s+.+$", ""));