-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.js
25 lines (24 loc) · 939 Bytes
/
common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function set_data(url)
{
var content = document.getElementById("content")
console.log(content)
var request = new XMLHttpRequest()
request.open("get",url,true)
request.onload=function()
{
console.log(request.status)
console.log("状态"+request.status)
// console.log(request.responseText)
out=request.responseText
if (request.readyState===request.DONE)
{
if(request.status===200)
{
console.log(request.responseText)
var final_content = request.responseText//.replaceAll("\n", "<br>").replaceAll("\\n", "")
content.innerHTML = final_content
}
}
}
request.send()
}