使用window.open 打开一个和当前页一样内容的窗口。
var printPreview = window.open('',"_blank","status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1,resizable=1") var printDocument = printPreview.document; printDocument.open(); var html = document.documentElement.innerHTML; printDocument.write("<html>"+html +"</html>"); printDocument.close();
相关推荐
Author David Herman, with his years of experience on Ecma’s JavaScript standardization committee, illuminates the language’s inner workings as never before—helping you take full advantage of ...
It's recommended for experienced programmers who want to learn the programming language of the Web, and for current JavaScript programmers who want to master it. 目录: Chapter 1 Introduction to ...
Window对象文档,对学习javascript基本的初学者很有帮助
对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...
javascript中window.confirm这个方法很好用,可以弹出一个确认对话框我们之所以弹出这个对话框,可能就是因为该操作很危险,所以要用户确认。但如果默认选择”确定”,则可能违背了这个原则。 另外,confirm对话框的...
The jQuery JavaScript framework is a rising star in the world of web development. JavaScript frameworks in general have grown to become immensely popular in the past few years in parallel with the ...
用Javascript实现游戏PopStar
This Fifth Edition is completely revised and expanded to cover JavaScript as it is used in today's Web 2.0 applications. This book is both an example-driven programmer's guide and a keep-on-your-desk ...
It's recommended for experienced programmers who want to learn the programming language of the Web, and for current JavaScript programmers who want to master it. 目录: Chapter 1 ...
The Good Parts defines a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole. Author Douglas Crockford, a member of JavaScript 2.0 committee at ECMA, is...
Part IV is a reference for client-side JavaScript, covering legacy web browser APIs, the standard Level 2 DOM API, and emerging standards such as the XMLHttpRequest object and the <canvas> tag. ...
What is and how to use inheritance and JavaScript inheritance as well as inheritance alternatives How to design for JavaScript What are and how to use OO principles in JavaScript How to use ...
javascript 打开页面window.location和window.open的区别.docx
对JavaScript中Window对象的所有方法进行了详细的说明!初学者值得 一看! 有极大的收藏价值!!
JavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow the inheritance pattern), there are some changes in writing data structures in JavaScript. The classical ...
It is far more efficient than downloading a bunch of data with the page and less visually disruptive than the old submit-and-wait-for-a-new-page process. To help put a label on the type of ...
The game examples in this book use pure JavaScript, so you can code as close to the metal as possible without having to be dependent on any limiting frameworks or game engines. No libraries, no ...
This book covers the JavaScript language and the JavaScript APIs implemented by web browsers. I wrote it for readers with at least some prior programming experience who want to learn JavaScript and ...
The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences. Certain features that appeared in ...
JavaScript derives its syntax, which is to say its grammar, from the ECMAScript standard and its features for manipulating XHTML, CSS, and HTTP from the DOM standard. Typically, JavaScript ...