Ok, I am going the cookie route. It seems to be the most logical for such a small thing. Here is what I have...
poster being the DIV
Code:
function createCookie(poster,value,0) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = poster+"="+value+expires+"; path=/";
}
function readCookie(poster) {
var posterEQ = poster + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(posterEQ) == 0) return c.substring(posterEQ.length,c.length);
}
return null;
}
function eraseCookie(poster) {
createCookie(poster,"",-1);
}
I have put the call for this cookie in the HTML page...
Code:
<script type="text/javascript" src="js/toppanel-cookie.js"></script>
However, Where do I go from here? Am I even doing this right?
|