Help needed: how to open external links without leaving current site

Discussion in 'HTML & Website Design' started by Imgar, Jul 25, 2012.

  1. #1
    Hello, i want visitors remaining at my site when they click external links, just like digg.com. it includes a top bar with two options(my site logo or info. also on the bar): go back to my site or remove the frame.

    I've been looking for the scripts , it seems to need javascript, frame ...

    does anyone can help me?
     
    Imgar, Jul 25, 2012 IP
  2. Bryan Zazz

    Bryan Zazz Peon

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    how about you open the new link in another tab?
    you can do that easily by adding a "_blank" target attribute.
    The target attribute specifies where to open the linked document:

    <a href="http://www.some-site.com" target="_blank">Visit some-site</a>

    As you can see, this involves zero JS or any other black magic.
    Just simple ole HTML.
    I hope that's what what you're looking for, else I misunderstood your q.
     
    Bryan Zazz, Jul 25, 2012 IP
  3. Imgar

    Imgar Greenhorn

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Hi Bryan Zazz
    thanks for your reply but i am afraid you misunderstood my purpose. what i want is a head with two options: go back to my site and remove the frame. I hope the script would automatically recognize the external links and then open them in the frame.
     
    Imgar, Jul 25, 2012 IP
  4. Bryan Zazz

    Bryan Zazz Peon

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    oops, sorry, my bad. Unfortunately, I never use frames, so can't help you there.
    But recognizing external links - provided you use jquery - is a piece of cake.
    With jquery I would do something like this:

    Note: in that example, anchor links stop behaving as they normally do
    and execute your code instead...

    hope that helped a bit.
    you can read more about jquery here:
    jquery.com
     
    Bryan Zazz, Jul 25, 2012 IP