SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening extrenal websites within a frame

    Hello guys,

    On my site, I have couple of links to external websites. When an user clicks on a link, a new window for that site opens up.

    Now, in this new window, I would like to have a small frame either at the top or at the bottom saying, "You are visiting a site out of Mysite.com!!! Please click here to go back or click here to close this message."

    I have seen couple of sites have this feature. How can I implement this feature.

    Any help will be appreciated :-)

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You actually may want to post this in the web design forums because it has more to do about that. If you're asking how to parse out external links in your page, and replace them with a link to your own page which forwards them, then you're in the right place.

    You'd have to do a regular expression search on the page for anchor tags. (<a> tags) and check the href property to see if it points to a domain outside of your own. If so, you can forward them to a page which says "You are leaving my site! Continue?"
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •