application.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. application_parameter = {};
  2. function application_get_init() {
  3. str = '<table border="1" width="100%">';
  4. str += '<tr><td colspan="2"><a href="#" id="get">get</a>&nbsp;<a href="#" id="getIcon">getIcon</a></td></tr>';
  5. str += '<tr><td>flag:</td><td><input type="text" id="flag" style="width:95%"/></td></tr>';
  6. str += '</table>';
  7. $('#content').html(str);
  8. $('#result').html('');
  9. $('#get').click(function() {
  10. application_get($('#flag').val());
  11. });
  12. $('#getIcon').click(function() {
  13. application_getIcon($('#flag').val());
  14. });
  15. }
  16. function application_get(flag) {
  17. $('#content').html('');
  18. $('#result').html('');
  19. $.ajax({
  20. type : 'get',
  21. dataType : 'json',
  22. url : '../jaxrs/application/' + flag,
  23. xhrFields : {
  24. 'withCredentials' : true
  25. },
  26. crossDomain : true
  27. }).always(function(json) {
  28. $('#result').html(JSON.stringify(json, null, 4));
  29. });
  30. }
  31. function application_getIcon(flag) {
  32. $('#content').html('');
  33. $('#result').html('');
  34. $.ajax({
  35. type : 'get',
  36. dataType : 'json',
  37. url : '../jaxrs/application/' + flag,
  38. xhrFields : {
  39. 'withCredentials' : true
  40. },
  41. crossDomain : true
  42. }).always(function(json) {
  43. $('#result').html(JSON.stringify(json, null, 4));
  44. });
  45. }
  46. function application_listWithPerson() {
  47. $('#content').html('');
  48. $('#result').html('');
  49. $.ajax({
  50. type : 'get',
  51. dataType : 'json',
  52. url : '../jaxrs/application/list',
  53. xhrFields : {
  54. 'withCredentials' : true
  55. },
  56. crossDomain : true
  57. }).always(function(json) {
  58. $('#result').html(JSON.stringify(json, null, 4));
  59. });
  60. }
  61. function application_listWithPersonComplex() {
  62. $('#content').html('');
  63. $('#result').html('');
  64. $.ajax({
  65. type : 'get',
  66. dataType : 'json',
  67. url : '../jaxrs/application/list/complex',
  68. xhrFields : {
  69. 'withCredentials' : true
  70. },
  71. crossDomain : true
  72. }).always(function(json) {
  73. $('#result').html(JSON.stringify(json, null, 4));
  74. });
  75. }