External Links Warning
From KickApps Documentation
Description
The following code snippet will redirect any external links within your ka_contentContainer to a Custom Blank Page Template which will warn your users that they are leaving the scope of the community pages.
Code
This code fires a JS event that redirects the user to the warning page (THIS GOES IN THE FOOTER SECTION OF THE GPT):
<script type="text/javascript">
$j('#ka_contentContainer a').click(function(){
if (this.toString().indexOf(Ka.Info.SERVERROOTDOMAIN) == -1) {
if(Ka.Info.PAGE != "pages/customPage.jsp"){
var href = $j(this).attr("href");
window.location = "/service/openCustomPage.kickAction?as="+Ka.Info.AFFILIATESITEID+"&title=External%20Link%20Alert&page=external_link&bodyClass=external_link&url=" + href;
return false;
}
}
});
</script>
Code
This is the code to create the Custom Blank Page for handling the external links (THIS GOES IN THE HEADER SECTION OF THE GPT):
<script type="text/javascript">
function onCustomPageLoaded(data) {
switch (data.page) {
case "external_link":
$j("#ka_customPage").html('You are about to leave '+Ka.Info.SITENAME+'
In an effort to stop phishing, we are warning you:
DO NOT ENTER YOUR '+Ka.Info.SITENAME+' PASSWORD on this new website!
This page is not meant to keep you from going to the link you\'ve clicked on. It is just a warning to not enter your '+Ka.Info.SITENAME+' password on this site, even if the page you visit looks like a '+Ka.Info.SITENAME+' login page. To go to the page, click the link below:.
Follow External Link To:
'+data.url+'
break;
} }
var newEventId = Ka.events.listen('custom-page-loaded', onCustomPageLoaded);
</script>
Favorites






