Jan 21, 2010

JavaScript Quick Solution

Below is a solution I programmed for my company's site at work. It involves redirecting the viewer to a warning page if the cookie is not recognized along with an alert pop up window. If the cookie is read, the viewer is taken to the actual content page.
Unfortunately there is no way in Blogger to separate the text and the HTML is limited so I was restricted and changed out all the greater than - less than symbols on the tags. Same with curly brackets.

[script language="JavaScript" type="text/javascript"]
if (document.cookie < 1)
[
var cliff = new Date();
cliff.setDate(cliff.getDate() + 1);
document.cookie = "International = Warning; expires =" + cliff.toGMTString() + " ; " ;
alert("You are about to enter a section of the website that has material and products that are not approved by the FDA. Products are not available for sale in the US.")
]
else [
window.location = "../international/INT_dermapaceAPP.html"
]
[/script]




No comments:

Post a Comment