logs.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. function logs_sys_search(go)
  2. {
  3. if($('#search').val() == '')
  4. {
  5. $('#search_error').css('display', 'none');
  6. return;
  7. }
  8. loading(1);
  9. if(go) go = '/go'; else go = '';
  10. $.ajax({
  11. type: 'POST',
  12. url: home+'logs/subsection/search'+go,
  13. data: 'text='+$('#search').val(),
  14. dataType: 'json',
  15. success: function(data)
  16. {
  17. $.each(data, function(i, val)
  18. {
  19. if(i == 'e')
  20. {
  21. if(val != '')
  22. {
  23. $('#search_error').css('display', 'inline-block');
  24. $('#search_error').html(val);
  25. }else
  26. $('#search_error').css('display', 'none');
  27. }
  28. if(i == 's')
  29. {
  30. $('#search_error').css('display', 'none');
  31. $('#search_result').html(val);
  32. }
  33. });
  34. loading(0);
  35. }
  36. });
  37. }
  38. function logs_search(go)
  39. {
  40. if($('#search').val() == '')
  41. {
  42. $('#search_error').css('display', 'none');
  43. return;
  44. }
  45. loading(1);
  46. if(go) go = '/go'; else go = '';
  47. $.ajax({
  48. type: 'POST',
  49. url: home+'logs/section/search'+go,
  50. data: 'text='+$('#search').val(),
  51. dataType: 'json',
  52. success: function(data)
  53. {
  54. $.each(data, function(i, val)
  55. {
  56. if(i == 'e')
  57. {
  58. if(val != '')
  59. {
  60. $('#search_error').css('display', 'inline-block');
  61. $('#search_error').html(val);
  62. }else
  63. $('#search_error').css('display', 'none');
  64. }
  65. if(i == 's')
  66. {
  67. $('#search_error').css('display', 'none');
  68. $('#search_result').html(val);
  69. }
  70. });
  71. loading(0);
  72. }
  73. });
  74. }