js获取网页源代码

2021-03-10  本文已影响0人  点沙微痕

          let sourceCodeTxt = '';

          var xhr = new XMLHttpRequest();

          xhr.open('GET', window.location.href, false);

          xhr.send();

          sourceCodeTxt= xhr.responseText;

上一篇 下一篇

猜你喜欢

热点阅读