index.html 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>首页</title>
  5. <link rel="stylesheet" href="/static/layui/css/layui.css">
  6. <link rel="stylesheet" href="/static/viewer/viewer.min.css">
  7. <script src="/static/jquery.min.js"></script>
  8. <script src="/static/layui/layui.js"></script>
  9. </head>
  10. <body>
  11. <p>{{ model }}</p>
  12. <div id="show">
  13. </div>
  14. </body>
  15. <script type="text/javascript">
  16. $(function (){
  17. load_data();
  18. });
  19. function load_data() {
  20. $("#show").empty();
  21. var action = "load_data"
  22. param = {}
  23. $.ajax({
  24. type: "POST",
  25. url: action,
  26. data: param,
  27. success: function (result) {
  28. try {
  29. for(let i=0; i<result.length; i++){
  30. rs = JSON.stringify(result);
  31. $("#show").append(rs + "<br/>");
  32. }
  33. } catch (e) {
  34. console.log(e)
  35. }
  36. },
  37. error: function () {
  38. console.log("请求失败!");
  39. }
  40. });
  41. }
  42. </script>
  43. </html>