Forum Moderators: open

Message Too Old, No Replies

Intercept redirect and announce message

Need to announce that users are leaving site before enacting 'link

         

thdoug28

2:12 am on Apr 28, 2007 (gmt 0)

10+ Year Member



I run a .gov site and am not a programmer, nor really a webmaster... but I do it, nonetheless. Where we have links to other sites, for legal reasons we need to delineate the change from a .gov domain to a non-.gov domain. I figured that the easiest way to do this is with a javascript, but have no idea how to do it. My thinking is something along the lines of what you get when a search engine returns potentially adult content and pops up a window with a warning/disclaimer but also a button which takes you to the page originally linked. I realize that search engine results are dynamically created, so there has to be some way to 'intercept', for lack of a better word, the URL in the 'link, recognize that it's not our domain, and not let visitors actually go to the site without clicking an 'OK' button or the like. Currently, I am using ScreenTips in FP to alert users of their potential to leave a .gov site, but this is kludgy at best. TIA.

rocknbil

6:31 am on Apr 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard thdoug28.

I recently had to do exactly this, also on a .gov site, it was a requirement. You are best *not* to do this using Javascript because it is then Javascript-dependent. You want some sort of server-side script to effect the exit message. A perl-y solution:

<a href="exit.cgi?url=http://www.some-offsite-link.com">some-offsite-link.com</a>

exit.cgi then displays something like

<p>You are exiting the $sitename web site. We claim no responsibility over third-party sites.</p><p> <a href="$data{'url'}">I understand and wish to move on</a>.</p>

It's an easy thing to do in perl, php, asp, coldFusion, etc., and maintains accessibility. My requirement was also "no new windows."

Dabrowski

12:28 pm on Apr 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hoooray! Somebody else who uses Perl!