this.update = function(jsonObject){
var jsonString = JSON.stringify(jsonObject);
var self = this;
this.xmlhttp.onreadystatechange=function(){
if (self.xmlhttp.readyState==4){
if (self.xmlhttp.status==200){
self.onUpdateSuccess.call(self,self.xmlhttp.responseText);
}else{
self.onUpdateError.call(self,self.xmlhttp.statusText);
}
}
}
this.xmlhttp.open("POST",this.resource_url,true);
this.xmlhttp.setRequestHeader("Content-type", "application/json");
this.xmlhttp.setRequestHeader("Content-length", jsonString.length);
this.xmlhttp.setRequestHeader("Connection", "close");
this.xmlhttp.send(jsonString);
}