Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Disclaimer Script

Posted on 2005-04-04
5
Medium Priority
?
1,793 Views
Last Modified: 2006-11-18
Hello,

I am building a Website for a Bank and they want a Disclaimer POP-UP to open everytime you click on a link that leaves their domain. examle" You are now leaving the First Bank Website First Bank is not responble for content provided by linked sites."
There site is going to have dozens of links to off site news,weather,stock market info, ect. I am in great need of some help coming up with a script in asp, cgi, javascript. I have tried my self but the popup comes up for internal links as well.

Thanks for help

Ed

0
Comment
Question by:edperks
5 Comments
 
LVL 9

Expert Comment

by:Wim_Bl
ID: 13699667
Hi,

can't you use the "onclick" event for the link, like this:

<a href="stockmarketsite" onclick="return showDisclaimer()">stock</a>

In the header, use a javascript:

<head>
<script>
   function showDisclaimer
   {
        // show the pop-up window here. use a modal form so the user has to click it away before going on
        return true
    }
</script>
</head>

I'm not sure about the exact syntax but you'll understand what I mean. You can even put the redirect itself in the javascript function, like this:

    //....
    //show popup
    window.location = "www.stockmarketsitestuff.com"


greetings
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13699725
similar to what Wim had said ... i use this for every external link on my intranet ...

<a href="javascript:externalLink('http://www.somesite.com');">
technically it should be
<a href="#" onclick="externalLink('http://www.somesite.com');">

but anyways ... the js code is just this
<script type="text/javascript">
<!--

function externalLink(lnk) {
  var popU;

  if (confirm(lnk+'\n\nDo you want to view this page?\nIt is outside of the intranet, so this only works if you have internet access.')) {
    popU = window.open(lnk,'_blank');
    if (!popU) {
      alert('Link was blocked.');
    }
  }
}
//-->
</script>
0
 
LVL 9

Accepted Solution

by:
cb1393 earned 2000 total points
ID: 13699726
How about this...


<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function checkLink(x){
      y = new String(x)
      z = /firstbank.com/gi;
      zPos = y.search(z)
      if(zPos>0){
            return true
      }else{
            if(confirm("You are now leaving the First Bank Website First Bank is not responble for content provided by linked sites.")){
                  return true
            }else{
                  return false
            }
      }
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF="http://www.firstbank.com/" onClick="return checkLink(this.href)">Internal Link</A><BR>
<A HREF="http://www.firstbank.com/property.asp" onClick="return checkLink(this.href)">Internal Link</A><BR>
<A HREF="http://www.sipc.org/" onClick="return checkLink(this.href)">External Link</A>
</BODY>
</HTML>
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13701266
just to fix my typo ... where I said it should be: (this is what it really should be)
<a href="#" onclick="externalLink('http://www.somesite.com');return false;">
0
 

Author Comment

by:edperks
ID: 13727204
Thanks cb1393 ,

Thats exactly what I was looking for!!




0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question