dialog.js 844 B

123456789101112131415161718192021222324252627282930
  1. dialog_parameter = {};
  2. function dialog_listTalk_init() {
  3. $('#result').html('');
  4. $('#content').html('');
  5. var str = '<table border="1" width="100%">';
  6. str += '<tr><td colspan="2"><a href="#" id="list">list</a></td></tr>';
  7. str += '<tr><td>person:</td><td><input type="text" id="person" style="width:95%"/></td></tr>';
  8. str += '</table>';
  9. $('#content').html(str);
  10. $('#list').click(function() {
  11. dialog_listTalk($('#person').val());
  12. });
  13. }
  14. function dialog_listTalk(person) {
  15. $('#result').html('');
  16. $.ajax({
  17. type : 'get',
  18. dataType : 'json',
  19. url : '../jaxrs/dialog/list/talk/person/' + person,
  20. contentType : 'application/json; charset=utf-8',
  21. xhrFields : {
  22. 'withCredentials' : true
  23. },
  24. crossDomain : true
  25. }).always(function(json) {
  26. $('#result').html(JSON.stringify(json, null, 4));
  27. });
  28. }