Opening popup windows in HTML

前端 未结 3 1489
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 00:07

I am working with web apps, and I am wondering if there is a way to open a link in an app-type window using HTML? Something like this:



        
相关标签:
3条回答
  • 2020-12-30 00:24

    Something like this?

    <a href="#" onClick="MyWindow=window.open('http://www.google.com','MyWindow','width=600,height=300'); return false;">Click Here</a>
    
    0 讨论(0)
  • 2020-12-30 00:26

    I feel like this is the simplest way. (Feel free to change the width and height values).

    <a href="http://www.google.com" 
    target="popup" 
    onclick="window.open('http://www.google.com','popup','width=600,height=600'); return false;">
    Link Text goes here...
    </a>
    
    0 讨论(0)
  • 2020-12-30 00:29

    HTML alone does not support this. You need to use some JS.

    And also consider nowadays people use popup blocker in browsers.

    <a href="javascript:window.open('document.aspx','mypopuptitle','width=600,height=400')">open popup</a>
    
    0 讨论(0)
提交回复
热议问题