Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NewB - How are they creating this alert?

Status
Not open for further replies.

qban21

Programmer
Aug 12, 2002
11
US
Hello,
I work for a financial institution and need to create a pop up that lets the member know they are leaving our site and that we are not responsible for the other web sites content. I like what this site has done, but am having trouble recreating it. Any help will be greatly appreciated! Thanks in advance!

On the left hand side click on anyone of the links under PARTNER LINKS and you will see what I am talking about. Thanks again!

-Edwin
 
well, this is how they are calling it:

Code:
<a onclick="return displayThirdPartyAlert(1,this);" ... href="[URL unfurl="true"]https://www.ezcardinfo.com/">[/URL]

and this is the function's code:

Code:
function displayThirdPartyAlert(msg,lk){
//You may have up to 5 different messages: 0, 1, 2, 3, 4
	var description = lk.innerHTML;

	if(description.indexOf('alt="') != -1){
	//alt tag description must be a least 2 words.
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	//content creation
	var content = new Array();
    var index = 0;
	if(msg == 1){
		content[index++] = '<h1>Third Party Site Disclaimer</h1><br>By accessing the noted link you will be leaving our website and entering <strong>' +description+ '</strong> located at <strong>'+ lk.href +'</strong> which is hosted by another party.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of <strong>' + description + '</strong> which you are entering, which may be different than those of our.';
	}
	else if(msg == 2){
		content[index++] = '<h1>Third Party Site Disclaimer</h1><br>By accessing the noted link you will be leaving our website and entering a third party site located at <strong>'+ lk.href +'</strong> which is hosted by another party.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the third party site which you are entering, which may be different than those of our.';
	}
	else{
	content[index++] = '<h1>Third Party Site Disclaimer</h1><br>By accessing the noted link you will be leaving Associated Credit Union\'s website and entering a website hosted by another party. Associated Credit Union  has not approved this as a reliable partner site.  Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of Associated Credit Union\'s website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of Associated Credit Union\'s.';
	}
	content[index++] = '<br><br><br>';
	content[index++] = '<div align="center"><a href="'+lk.href+'" target="_blank" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.visibility = "visible";
	scrollTo(0,0);
	return false;
}

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

[banghead]
 
Thanks, cLFlaVA! Did you find the function within the source code or is the function code in it's own page? Thanks!

-Edwin
 
I understand how they are calling it, but where is the function code placed. I am pulling my hair out here. Any help please! I am totally new to javascript. Thanks again!

-Edwin
 
yeah I know, that was my bad! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top