nap.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <html>
  2. <head>
  3. <title>The jQuery Example</title>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  5. </head>
  6. <body>
  7. <h1>
  8. <div id="title">
  9. NAP ID
  10. </div>
  11. </h1>
  12. <div id="stage">
  13. </div>
  14. <script type="text/javascript" language="javascript">
  15. $(document).ready(function () {
  16. var url = "http://200.50.160.234:8088/api/v1/nap?id=1";
  17. console.log(url);
  18. $.ajax({
  19. url: url,
  20. type: "GET",
  21. crossDomain: true,
  22. data: "id=1",
  23. dataType: "json",
  24. success: function (response) {
  25. $('#stage').html(response);
  26. console.log(response);
  27. console.log("fin success");
  28. },
  29. error: function (xhr, status) {
  30. $('#stage').html(status);
  31. console.log(status);
  32. console.log(xhr);
  33. console.log("fin error");
  34. }
  35. }
  36. );
  37. // $.get(
  38. // url,
  39. // crossDomain: true,
  40. // function (data) {
  41. // $('#stage').html(data);
  42. // }
  43. // );
  44. });
  45. </script>
  46. </body>
  47. </html>