Loading Menu Link In New Window

Last post 08-26-2011, 11:25 AM by DotCreativity. 3 replies.
Sort Posts:
  •  08-25-2011, 10:51 AM 23501

    • rgorga is not online. Last active: 11-01-2011, 11:46 AM rgorga
    • Top 150 Contributor
    • Joined about 10 months ago
    • Posts 16

    Loading Menu Link In New Window

    I need one of the menu links to load an external link on another web site but it must loaded in a new window.

     

    I have been able to have menu links redirect to another page with Javascript in the past but can't figure out how to load the link in a new window.

     

    I tried this but it isn't working for some reason:

     

    <script type="text/javascript">

    try {

    if (!top.adminpanel) {
       window.open ("http://sasf.biz/","mywindow");
    }

    }

    catch(e) {}

    </script>

     

  •  08-25-2011, 11:39 AM 23502 in reply to 23501

    Re: Loading Menu Link In New Window

    It's virtually impossible to open new windows via JavaScript these days as they are blocked by pretty much all browsers. If you do a search on Google you can find some work around, but they mostly don't work. Browsers won't open a new window unless it's a direct result of something someone did, such as click a link with a target property, like this:

     

    <a href="http://sasf.biz" target="_blank">My Link</a>

     


    Matthieu (Ex-Apricot)
    Please contact support directly for assistance on any of my posts as I will no longer be checking these forums: support@wildapricot.com
  •  08-25-2011, 12:01 PM 23504 in reply to 23502

    • rgorga is not online. Last active: 11-01-2011, 11:46 AM rgorga
    • Top 150 Contributor
    • Joined about 10 months ago
    • Posts 16

    Re: Loading Menu Link In New Window

    Ok so it looks like javascript new windows are out of the question. Would WA support be able to add this external link to my menu bar? If not would it be possible to change the href and target attributes of a WA menu link using javascript? My knowledge of javascript is somewhat basic but if someone leads me in the right direction I can probably figure it out.

     

    This functionality seems so simple... There has to be a way someone from WA can do it. Or myself with javascript.

  •  08-26-2011, 11:25 AM 23514 in reply to 23504

    Re: Loading Menu Link In New Window

    Hello,

    It certainly is possible to change the link and target using JavaScript - this would be done by targeting the ID of that menu link.

    If this is something you would need help with, shoot me an email.


    DotCreativity Web Design Services
    http://www.dotcreativity.com
    Email: ideas@dotcreativity.com
View as RSS news feed in XML
Membership Software - Wild Apricot