How can I open two pages from a single click without using JavaScript?

前端 未结 6 1334
时光说笑
时光说笑 2020-12-13 19:38

I have some text in a link. When I click on it I must open 2 pages. No problem here... but the trick is that I am not allowed to use JavaScript. Is this possible only with H

相关标签:
6条回答
  • 2020-12-13 20:10

    also you can open more than two page try this

    `<a href="http://www.microsoft.com" target="_blank" onclick="window.open('http://www.google.com'); window.open('http://www.yahoo.com');">Click Here</a>`
    
    0 讨论(0)
  • 2020-12-13 20:13

    Without JavaScript, it's not possible to open two pages by clicking one link unless both pages are framed on the one page that opens from clicking the link. With JS it's trivial:

    <p><a href="#" onclick="window.open('http://google.com');
        window.open('http://yahoo.com');">Click to open Google and Yahoo</a></p>
    

    Do note that this will be blocked by popup blockers built into web browsers but you are usually notified of this.

    0 讨论(0)
  • 2020-12-13 20:14
    <a href="http://www.omsaicreche.blogspot.com" onclick="location.href='http://www.omsaivatikanoida.blogspot.com';" target="_blank">Open Two Links With One Click</a>
    

    I tried the above codes. I could not get success in old page. Than I created a new page in blogger and types following codes... I was successful

    0 讨论(0)
  • 2020-12-13 20:27

    it is working perfectly by only using html

    <p><a href="#"onclick="window.open('http://google.com');window.open('http://yahoo.com');">Click to open Google and Yahoo</a></p>
    
    0 讨论(0)
  • 2020-12-13 20:34

    it is not possible to do using only html

    0 讨论(0)
  • 2020-12-13 20:36

    If you have the authority to edit the pages to be opened, you can href to 'A' page and in the A page you can put link to B page in onpageload attribute of body tag.

    0 讨论(0)
提交回复
热议问题