Skip to main content
Participant
November 16, 2021
Question

How to open external link in Dreamweaver in same tab

  • November 16, 2021
  • 2 replies
  • 455 views

I want to make a hyperlink to an amazon page, childrens books.

 

<li><a href="#" onclick="MM_openBrWindow('https://www.amazon.com.au/Children-Books/b?ie=UTF8&node=4893846051');return false">Children's Books</a></li>

 

this is my code. The link works fine, except it opens the amazon link in a seperate window. I want it to replace the current window with the amazon page. I think this is because of "MM_openBrWindow"

 

What can I replace this with so the amazon tab will open in the same tab/window?

 

I am new to dreamweaver and HTML in general so please be thorough

thanks,

    This topic has been closed for replies.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    November 16, 2021

    I agree with Jon.  There's no reason to use a JavaScript event trigger when you don't have to.  Ordinary HTML is all you need.

     

    To open external links in a new browser window or tab on desktops,  add target="new" to the anchor tag.

    <a href="https://www.amazon.com.au/Children-Books/b?ie=UTF8&node=4893846051" target="new">Children's Books</a>

     

    Note: mobile browsers only have one window.

    Number of Mobile Internet Users Increased to 92.6%

     

    Nancy O'Shea— Product User & Community Expert
    Participant
    November 17, 2021

    For some reason, Jons link gave me a 'amazon refused to connect' screen, but yours worked how it should.

    I didnt put a javascript event trigger there, I dont even know what that is. I'ts part of an assignment where I have to fix the issues with the website. I downloaded the code from my teacher. This was the one thing I couldnt figure out. 

     

    Big thanks.

    Jon Fritz
    Community Expert
    Community Expert
    November 16, 2021

    If you just want the link to go to the new page, get rid of the script and use a standard <a href> link...

    <li><a href="https://www.amazon.com.au/Children-Books/b?ie=UTF8&node=4893846051">Children's Books</a></li>