私はあなたがこれを行うことができると思います...
<html>
<head>
<script>
/* getUrlVars function from http://papermashup.com/read-url-get-variables-withjavascript/
*/
function getUrlVars()
{
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
/*
* getCookie and checkCookie function
* credit http://www.w3schools.com/js/js_cookies.asp
*/
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}
function checkCookie()
{
var getConfirmationID = getUrlVars('confirmationid');
var confirmation =getCookie(getConfirmationID);
if (confirmation!=null && confirmation!="")
{
alert("Page expired, redirecting....");
window.location = "/originalForm.html";
}
else
{
/*
* show the confirmation
*/
document.getElementById('confirmationdata').innerHTML = '<p>'+confirmation+'</p>';
}
}
}
</script>
</head>
<body onload="checkCookie()">
<div id='confirmationdata'></div>
</body>
</html>