hello.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html><head><meta charset="utf-8">
  2. <title>Hello,亲: 本WebAPI支持IP城市定位和域名查IP定位</title>
  3. </head>
  4. <html><body style="text-align:center;">
  5. {% if ip %}
  6. <h1>Hello, 来自{{ ip }} 的亲:</h1>
  7. <h3>{{ ipaddr }}</h3> <br><br><br>
  8. <div><input id="name" type="text">
  9. <input type="button" id="btn" value="提交"></div>
  10. <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  11. <script>
  12. function enter() {
  13. var event = arguments.callee.caller.arguments[0] || window.event;
  14. if (event.keyCode == 13) {
  15. jump_url()
  16. }
  17. }
  18. $("#btn").click(function () {
  19. jump_url()
  20. })
  21. function jump_url(params) {
  22. var name = $("#name").val();
  23. const url = window.location.href;
  24. window.location.href = url + name
  25. }
  26. </script>
  27. <br><br><br><br><br><br>
  28. 本WebAPI支持IP城市定位和域名查IP定位,同时支持命令行查询
  29. <h3>搭建WebAPI参考文章</h3>
  30. <a href="https://262235.xyz/index.php/archives/342/">Python网络开发简单的IP城市定位WebAPI</a>
  31. <p>
  32. <h3>命令行 curl 使用:</h3>
  33. <pre>
  34. curl https://262235.xyz/ip/ # 命令行 URL 要带 /
  35. curl https://262235.xyz/ip/8.8.8.8 # 查询自定义 IP 定位
  36. curl https://262235.xyz/ip/github.com # 按域名查 IP 定位
  37. {% else %}
  38. <h1>Hello World!</h1>
  39. {% endif %}