• Skip to main content
  • Skip to search
  • Skip to select language
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Technology

      Web technology reference for developers

  • Guides
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • MDN Plus
    • Overview

      More MDN. Your MDN.

    • FAQ

      Frequently asked questions about MDN Plus

  • Already a subscriber?
  • Get MDN Plus
  1. Web 开发技术
  2. Web API 接口参考
  3. Window
  4. window.print

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

In this article

  • 概述
  • 语法
  • 规范
  • 相关链接

Related Topics

  1. Window
  2. 属性
    1. Deprecated applicationCache
    2. closed
    3. console
    4. customElements
    5. Deprecated defaultStatus
    6. devicePixelRatio
    7. document
    8. event
    9. frameElement
    10. frames
    11. Non-Standard fullScreen
    12. history
    13. innerHeight
    14. innerWidth
    15. length
    16. localStorage
    17. location
    18. locationbar
    19. menubar
    20. mozInnerScreenX
    21. mozInnerScreenY
    22. Non-Standard Deprecated mozPaintCount
    23. name
    24. navigator
    25. Deprecated ondragdrop
    26. opener
    27. outerHeight
    28. outerWidth
    29. pageXOffset
    30. pageYOffset
    31. parent
    32. personalbar
    33. screen
    34. screenLeft
    35. screenTop
    36. screenX
    37. screenY
    38. scrollbars
    39. Non-Standard scrollMaxX
    40. Non-Standard scrollMaxY
    41. scrollX
    42. scrollY
    43. self
    44. sessionStorage
    45. Non-Standard sidebar
    46. speechSynthesis (en-US)
    47. status (en-US)
    48. statusbar (en-US)
    49. toolbar (en-US)
    50. top
    51. visualViewport
    52. window
  3. 方法
    1. alert()
    2. Non-Standard Deprecated back()
    3. blur()
    4. Experimental cancelAnimationFrame()
    5. cancelIdleCallback()
    6. Non-Standard captureEvents() (en-US)
    7. clearImmediate()
    8. close()
    9. confirm()
    10. Non-Standard convertPointFromNodeToPage() (en-US)
    11. Non-Standard convertPointFromPageToNode() (en-US)
    12. Non-Standard dump()
    13. Non-Standard find()
    14. focus()
    15. Non-Standard Deprecated forward() (en-US)
    16. getComputedStyle()
    17. getDefaultComputedStyle()
    18. getSelection()
    19. matchMedia()
    20. moveBy()
    21. moveTo()
    22. open()
    23. Non-Standard openDialog()
    24. postMessage()
    25. print()
    26. prompt()
    27. Non-Standard releaseEvents() (en-US)
    28. requestAnimationFrame()
    29. Non-Standard Deprecated requestFileSystem()
    30. requestIdleCallback()
    31. resizeBy()
    32. resizeTo()
    33. scroll()
    34. scrollBy()
    35. Non-Standard scrollByLines()
    36. Non-Standard scrollByPages()
    37. scrollTo()
    38. Non-Standard setImmediate()
    39. showDirectoryPicker() (en-US)
    40. Deprecated showModalDialog()
    41. showOpenFilePicker() (en-US)
    42. showSaveFilePicker() (en-US)
    43. sizeToContent()
    44. stop()
    45. updateCommands()
  4. Events
    1. event
    2. afterprint
    3. animationcancel (en-US)
    4. animationend (en-US)
    5. animationiteration (en-US)
    6. beforeinstallprompt
    7. beforeprint
    8. beforeunload
    9. blur
    10. copy
    11. cut (en-US)
    12. deviceorientationabsolute
    13. DOMContentLoaded
    14. error
    15. focus
    16. gamepadconnected
    17. hashchange
    18. languagechange
    19. load
    20. message
    21. messageerror
    22. offline
    23. online
    24. orientationchange
    25. pagehide
    26. pageshow
    27. paste (en-US)
    28. popstate
    29. rejectionhandled
    30. storage
    31. transitioncancel (en-US)
    32. unhandledrejection
    33. unload
    34. Deprecated vrdisplayactivate (en-US)
    35. Deprecated vrdisplayblur (en-US)
    36. Deprecated vrdisplayconnect (en-US)
    37. Deprecated vrdisplaydeactivate (en-US)
    38. Deprecated vrdisplaydisconnect (en-US)
    39. Deprecated vrdisplayfocus (en-US)
    40. Deprecated vrdisplaypointerrestricted (en-US)
    41. Deprecated vrdisplaypointerunrestricted (en-US)
    42. Deprecated vrdisplaypresentchange (en-US)
  5. 继承
    1. EventTarget

In this article

  • 概述
  • 语法
  • 规范
  • 相关链接

window.print

概述

打开打印对话框打印当前文档.

语法

window.print()

规范

DOM Level 0 不属于任何标准.

相关链接

  1. Printing
  2. window.onbeforeprint
  3. window.onafterprint

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: 2022年3月22日, by MDN contributors

Your blueprint for a better internet.

  • MDN on Twitter
  • MDN on GitHub

MDN

  • About
  • Hacks Blog
  • Careers

Support

  • Product help
  • Report a page issue
  • Report a site issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2022 by individual mozilla.org contributors. Content available under a Creative Commons license.