Skip to content

Instantly share code, notes, and snippets.

@fmpwizard
Created June 15, 2011 18:50
Show Gist options
  • Save fmpwizard/1027801 to your computer and use it in GitHub Desktop.
Save fmpwizard/1027801 to your computer and use it in GitHub Desktop.
var cometName= $('#cometName').val();
//alert(cometName);
jQuery.ajax({
type: 'PUT',
contentType: "application/json",
//url: "http://" + window.location.hostname +
// ":"+window.document.location.port+"/v1/rest/cities",
url: "http://dmedina.scala-tools.org/2/v1/rest/cities",
dataType: "json",
data: "{\"comet_name\":\""+ cometName +"\",\"id\":\"" + url +"\"}",
success: function() {
//alert('Put Success');
},
error: function(a,b,c) {
console.log("XMLHttpRequest: " + a);
console.log("textStatus: " + b);
console.log("errorThrown: " + c);
alert("XMLHttpRequest : " + a + " textStatus : " + b + " errorThrown : " + c);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment