Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #382

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
使用动态的 <script>
  • Loading branch information
chenyinheng30 committed Nov 15, 2023
commit 72a9dca768bf3d998e720161e9eed22eed2a54f1
5 changes: 4 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
var weatherElement = document.getElementById("weather");
weatherElement.innerHTML = `ip: ${ipData.query} ${ipData.city}`;
}
const url = 'http:https://ip-api.com/json?fields=8208&lang=zh-CN&callback=handleIpApi';
const script = document.createElement('script');
script.src = url;
document.body.appendChild(script);
</script>
<script src="http:https://ip-api.com/json?fields=8208&lang=zh-CN&callback=handleIpApi"></script>

{{- /* Profile */ -}}
{{- if ne $profile.enable false -}}
Expand Down