`
hb_keepmoving
  • 浏览: 230502 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

javascript pop up window which is the same as current page

 
阅读更多
使用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();

 

 

 

分享到:
评论

相关推荐

    JavaScript bom操作 window对象的方法 示例代码

    JavaScript bom操作 window对象的方法 示例代码JavaScript bom操作 window对象的方法 示例代码JavaScript bom操作 window对象的方法 示例代码JavaScript bom操作 window对象的方法 示例代码JavaScript bom操作 ...

    Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript[EPUB版]

    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 ...

    JavaScript权威指南(第6版).JavaScript:The.Definitive.Guide

    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 ...

    Open link in same tab, pop-up as tab-crx插件

    **Open link in same tab, pop-up as tab-crx插件详解** 在当今互联网环境中,浏览器扩展程序已经成为提高浏览效率和个性化体验的重要工具。"Open link in same tab, pop-up as tab-crx" 是一个专为Google Chrome...

    Javascript中封装window.open解决不兼容问题

    对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...

    google不支持window.showModalDialog问题解决方案

    This is a `window.showModalDialog()` shim using a modal HTML5 `&lt;dialog&gt;` element and ECMAScript 6 Generators. It was tested in the latest Google Chrome with the *Enable Experimental JavaScript* flag ...

    Beginning JavaScript, 4th Edition

    Includes improved examples on the most up-to-date JavaScript programming techniquesContinuing in the superlative tradition of the first three editions, Beginning JavaScript, Fourth Edition, gets you ...

    Beginning JavaScript with DOM Scripting and Ajax: Second Editon

    This completely updated second edition covers everything you need to know to get up-to-speed with JavaScript development and add dynamic enhancements to web pages, right from the basics. As well as ...

    Beginning JavaScript with DOM Scripting and Ajax (pdf + ePub)

    As well as focusing on client-side JavaScript, you will also learn how to work with the Browser Object Model, the Document Object Model (DOM), how to use XML and JSON as well as communicate with ...

    JavaScript and Open Data 2018 pdf

    and JavaScript as the scripting language. The interface with the elements and events of the HTML DOM (“document object model”) allows for the dynamic enrichment of the page on the “client side”. ...

    [Head.First.JavaScript].Michael.Morrison...

    Weekend at Bernie’s propping up a lifeless web page. Real live interactivity requires a bit more smarts and a little more work... but it has a much bigger payoff. the interactive web (Online) people ...

    Single Page Web Applications JavaScript end-to-end

    And you’ll learn how to capitalize on trends like server-side JavaScript and NoSQL data stores, as well as new frameworks that make JavaScript more manageable and testable as a first-class language....

    Javascript Manual Of Style

    &lt;br/&gt;The second section consists of six chapters, all of which contain a complete JavaScript Web page. Each chapter introduces a problem, demonstrates how you might solve it without JavaScript, ...

    The Definitive Guide to AdonisJs_Building Node.js App with JavaScript-2018

    Beyond adding a CSS framework, everything is as the good browser vendors intended. That said, I welcome you to add your own style to the application We’ll create a secure registration and login ...

    BobBuilder_app

    As you can see the page list is a sorted dictionary of first keys from each page along with associated page number and page items count. A page is a dictionary of key and record number pairs. This ...

    JavaScript权威指南(第6版)

    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 ...

Global site tag (gtag.js) - Google Analytics