js獲取整個頁面源碼

  1. 通過 outerHTML
    document.documentElement.outerHTML
    
  2. 通過異步請求
    $.get(window.location.href,function(res){
       console.log(res);
    });
    
  3. 通過jQuery
    $("html").html();
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章