Skip to main content
Participant
Nov 16, 2021 11:32 AM UTC
Question

How to open external link in Dreamweaver in same tab

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 is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    Nov 16, 2021 7:30 PM UTC

    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%

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Participant
    Nov 17, 2021 8:34 AM UTC

    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.

    Translate
    Jon Fritz
    Community Expert
    Community Expert
    Nov 16, 2021 1:33 PM UTC

    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>

    Translate