servletTest.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="Generator" content="EditPlus®">
  6. <meta name="Author" content="">
  7. <meta name="Keywords" content="">
  8. <meta name="Description" content="">
  9. <title>Document</title>
  10. <script src="assets/js/jquery-3.1.0.js"></script>
  11. <script type="text/javascript">
  12. function doquery(){
  13. method = "getNewCameraInfo";
  14. data = "&1&10";
  15. $.ajax({
  16. type: "POST",
  17. url: "http://localhost:8080/HK_HKVISION/GetVideo",
  18. data:{method:method,data:data},
  19. dataType: "text",
  20. success: function(data) {
  21. alert(data);
  22. if (data.isSuccess) {
  23. showMsg('添加成功!');
  24. listAllUser();
  25. } else {
  26. showMsg('添加失败!');
  27. listAllUser();
  28. }
  29. },
  30. error: function(e) {
  31. console.log("ajax error");
  32. },
  33. });
  34. }
  35. function doq(){
  36. $.ajax({
  37. type: "post", // 或者 "get"
  38. url: "http://localhost:8080/test/servlet/requestTest",
  39. dataType: "text",
  40. data:"",
  41. jsonp: "callback",
  42. success: function(json) {
  43. var ss = "";
  44. },
  45. error:function(data) {
  46. var ss = "";
  47. }
  48. });
  49. }
  50. </script>
  51. </head>
  52. <body>
  53. <div>
  54. <input type="button" value = "aaa" onclick="doquery()"/>
  55. </div>
  56. </body>
  57. </html>