Disclaimer Script

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

edperksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wim_BlCommented:
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
ThaSmartUnoCommented:
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
cb1393Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ThaSmartUnoCommented:
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
edperksAuthor Commented:
Thanks cb1393 ,

Thats exactly what I was looking for!!




0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.