js获取网页源代码
2021-03-10 本文已影响0人
点沙微痕
let sourceCodeTxt = '';
var xhr = new XMLHttpRequest();
xhr.open('GET', window.location.href, false);
xhr.send();
sourceCodeTxt= xhr.responseText;
let sourceCodeTxt = '';
var xhr = new XMLHttpRequest();
xhr.open('GET', window.location.href, false);
xhr.send();
sourceCodeTxt= xhr.responseText;