<script src="/js/jquery-1.11.1.min.js"></script>
$(document).ready(function(){
$("button").click(function(){
txt+="Document width/height: " + $(document).width();
txt+="x" + $(document).height() + "\n";
txt+="Window width/height: " + $(window).width();
txt+="x" + $(window).height();
<button>显示文档和窗口的尺寸</button>