Forum Moderators: open
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin!= 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function timedRead()
{
if (getCookie('thumburl'))
var thumburl = getCookie('thumburl');
document.write('<img src=\"' + thumburl + '\" alt=\"Current Image\" />');
} else {
document.write('<input type=\"button\" class=\"submit\" value=\"Get image »\" onClick=\"::opens window::\">');
}
}
setInterval(timedRead(),30000);
Hopefully someone will see where I have problems, the getCookie script came from the internet, and is as I found it...
I'm setting the thumburl using PHP in the popup, which would be linked to if the cookie didn't exist.
Any help is appreciated :)