?
Solved

Disclaimer Script

Posted on 2005-04-04
5
Medium Priority
?
1,784 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

770 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