| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- function doget() {
- var url = '../jaxrs/'+$("#url").val();
- alert(url);
- $.ajax({
- type : 'get',
- dataType : 'json',
- contentType : 'application/json; charset=utf-8',
- url : url,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html( JSON.stringify( json, null, 4) );
- }).fail(function(json) {
- failure(json);
- });
- }
- function dopost() {
- var url = '../jaxrs/'+$("#url").val();
- alert(url);
- $.ajax({
- type : 'post',
- dataType : 'json',
- contentType : 'application/json; charset=utf-8',
- url : url ,
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify($.parseJSON($('#content').val())),
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json.data, null, 4));
- });
- }
- function doput() {
- var url = '../jaxrs/'+$("#url").val();
- alert(url);
- $.ajax({
- type : 'put',
- dataType : 'json',
- contentType : 'application/json; charset=utf-8',
- url : url ,
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify($.parseJSON($('#content').val())),
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json.data, null, 4));
- });
- }
- function dodelete() {
- var url = '../jaxrs/'+$("#url").val();
- alert(url);
- $.ajax({
- type : 'delete',
- dataType : 'json',
- contentType : 'application/json; charset=utf-8',
- url : url,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json.data, null, 4));
- });
- }
|