• Hi,
    I have quite a few links and they are all set up to open in a new window. However the first link clicked opens a new window and any others use the same new window. How can I get them to open individual windows?
    TIA
    Phillip

Viewing 8 replies - 1 through 8 (of 8 total)
  • Does this work: NameOfMySite

    Thread Starter planetphillip

    (@planetphillip)

    Yes, if i put the html code in the page directly each link opens in a individual window.

    So that is what you want, right?

    Thread Starter planetphillip

    (@planetphillip)

    OK, problem solved. After prara posted the code point it got me thinking about the code in MySQl db. I actually imported all my links directly into the table but instead of putting “_blank” I put “blank”. DOH! At least I’ve leanrt the difference now. All I need to do is convert all 244 links to “_blank” now. Anybody know an easy way besides reimporting the data?

    Here Phillip – a shield – an emergency medical kit – and oh yes – you will need these happy pills – I somehow think you have tough times ahead ?? Ouch!

    You could make a javascript like this one:
    function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName(“a”);
    for (var i=0; i
    var anchor = anchors[i];
    if (anchor.getAttribute(“href”) &&
    anchor.getAttribute(“target”) == “blank”)
    anchor.target = “_blank”;
    }
    }
    window.onload = externalLinks;

    Just do an update of wp_links:
    UPDATE wp_links SET link_target = REPLACE ( link_target,
    ‘blank’,
    ‘_blank’ );

    Thread Starter planetphillip

    (@planetphillip)

    MattRead: Thanks for the code but I decided to replace the data because I wanted to make a few other changes.
    Beel: Also, thanks for the code but I had no idea how to run that code. ANyway I just emptied the table and loaded a text file.
    Thanks for the replies.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Links opening in the same new window.’ is closed to new replies.