正是标题所说的。
我的代码:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
var datas;
$.get("http://gdbrowser.com/api/profile/RobTop", function(data) {
datas = data;
document.getElementById("hhh").innerHTML = datas;
});
</script>
</head>
<body>
<h1 id="hhh"></h1>
</body>
我尝试使用getJSON和ajax,均无效
我尝试使用外部脚本
我尝试使用alert()的方法
将脚本移动到</body>
元素之前:
...
<script>
$.get("http://gdbrowser.com/api/profile/RobTop", function(data) {
// output?
console.log('data: ', data);
document.getElementById("hhh").innerHTML = data;
});
</script>
</body>