console
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML =this.responseText;
}
};
xhttp.open("GET", "https://www.w3school.com.cn/js/js_ajax_examples.asp", true);
xhttp.send();
}
<!DOCTYPE html>
<html>
<style>
#main {
width: 800px;
height: 400px;
margin: 50px auto;
</style>
<head>
<meta charset="utf-8">
<title>文档标题</title>
<div class="main">
<div id="map"></div>
</div>
</head>
<body>
</body>
</html>