打印整个HTML页面的代码,为啥不正确? 显示 null ? <script type="text/javascript">$(function(){ alert($(document).html());})</script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你这么写是不是因为dom还没加载完?试试这样写(不知道行不行)$(document).ready(function( alert($(document).html());));大概这个样子,我怀疑是因为你这么写是直接运行,dom还没开始加载 我的是dom加载以后运行的你的不知道,怀疑是dom还没加载就开始运行了。 <script type="text/javascript">(function($) { $.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() : $('<p>').append(this.eq(0).clone()).html(); }})(jQuery);$(function(){ alert($(document).outerHTML()); })</script> <script type="text/javascript">(function($) { $.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() : $('<p>').append(this.eq(0).clone()).html(); }})(jQuery);$(function(){ alert($(document).outerHTML()); })</script> 请问JS中!!表示什么? 文本的宽度怎么调不了JS里面 怎样使flash变成灰色 textContent和innerText有所不同 如何解决 请大家对EXT进行一下评价 window.confirm()的问题? !!求救!!!!这段代码错在哪拉????? 一种关于popup窗体事件的接收解决办法,欢迎大家讨论~ radio的问题! 高分求解,innerHTML切换图片后不跳转链接问题 分页实现复选框的选择 怎么改变指定字符的样式?
试试这样写(不知道行不行)
$(document).ready(function(
alert($(document).html());
));
大概这个样子,我怀疑是因为你这么写是直接运行,dom还没开始加载
你的不知道,怀疑是dom还没加载就开始运行了。
(function($) {
$.fn.outerHTML = function(s) {
return (s)
? this.before(s).remove()
: $('<p>').append(this.eq(0).clone()).html();
}
})(jQuery);
$(function(){
alert($(document).outerHTML());
})
</script>
<script type="text/javascript">
(function($) {
$.fn.outerHTML = function(s) {
return (s)
? this.before(s).remove()
: $('<p>').append(this.eq(0).clone()).html();
}
})(jQuery);
$(function(){
alert($(document).outerHTML());
})
</script>