--- a/src/main/resources/scripts/tracker.js Tue Aug 23 17:05:59 2011 -0400
+++ b/src/main/resources/scripts/tracker.js Tue Aug 23 17:06:17 2011 -0400
@@ -54,14 +54,14 @@
},
// send information to the server as JSON
- sendAsJSON : function (uri, data) {
+ postNewResourceAsJSON : function (uri, data) {
var xhr = new XMLHttpRequest;
try {
xhr.open("POST", uri, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
- if (xhr.status != 200) { // this needs to be 201
+ if (xhr.status != 201) {
Util.log("xhr failed? [" + xhr.status + "] " + xhr.statusText);
} else {
Util.log("resource created at " + xhr.getResponseHeader("Location"));
@@ -320,7 +320,7 @@
document.getElementById("start").textContent = "Start";
document.getElementById("stop").disabled = true;
Util.log("");
- if (!Util.sendAsJSON(app.user.getPostRunURI(),app.currentActivity)) {
+ if (!Util.postNewResourceAsJSON(app.user.getPostRunURI(),app.currentActivity)) {
if (!Util.store.set("track_gps_app", app.currentActivity)) {
Util.log("[ERROR] Can't store the value " + e.code);
}