通过 outerhtml
document.documentElement.outerHTML
通过异步请求
$.get(window.location.href,function(res){ console.log(res); });
通过jQuery
$("html").html();
以上就是JavaScript获取当前网页源码的实例的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号