[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Alert telling people they are leaving the site

Posted on 2011-03-07
7
Medium Priority
?
205 Views
Last Modified: 2012-05-11
I have a website with four links to outside websites. The client wants a box to appear when they click one of these links that says - You are now visiting a site outside of the ourwebsite. To return to our website, close this browser.

Any quick things I can add for this?
0
Comment
Question by:katlees
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 35058730
0
 
LVL 7

Expert Comment

by:dxdinh
ID: 35058892
<script language="javascript">

function Redirect (url)
{
   if (confirm('Are you sure - you want to leave our site?'))
{
   document.location.href= url ;
}
}


<a href="#" onclick="Redirect('http://www.outlink.com');"> outside link 1</a>
0
 

Author Comment

by:katlees
ID: 35059065
dxdinh - this did not work. It doesn't go anywhere and no pop up shows up.
0
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.

 
LVL 7

Expert Comment

by:dxdinh
ID: 35059142
I forgot the close script tag
Can u try
onclick="javascript:Redirect(...
0
 

Author Comment

by:katlees
ID: 35059472
This is what I Have so far.. It doesn't do anything when I click on it.

<script language="javascript">
function Redirect (url)
{
   if (confirm('You are now visiting a site outside of the Bank's website. To return to Bank's website, close this browser.'))
{
   document.location.href= url ;
}
}
</script>
<p><a onclick="javascript:Redirect ('https://usa.visa.com/personal/security/vbv/index.html?ep=v_sym_verified');" href="#">Verified By Visa Account Notification</a>
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 35059525
Escape the simple quotes in your message using : \


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
	function Redirect (url) {
		if( confirm('You are now visiting a site outside of the Bank\'s website. To return to Bank\'s website, close this browser.') ) {
	   		document.location.href = url;
			return false;
		}
		return false;
	}
</script>
</head>
<body>
<p><a onclick="return Redirect('https://usa.visa.com/personal/security/vbv/index.html?ep=v_sym_verified');" href="#">Verified By Visa Account Notification</a>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:katlees
ID: 35059779
Perfect - thanks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

650 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