Forum Moderators: open
function setCookie(name, value, expire) {
var exdate = new Date();
exdate.setDate(exdate.getDate()+expire);
document.cookie=name+ "=" +escape(value)+((expire==null) ? "" : ";expires="+exdate.toGMTString());
}
// When I click a button
// Update the cookie
setCookie("test", "1");
function getContent() {
// Get the data of our new URL
$.get("index.php", loadContent);
}
function loadContent(data) {
// alert the new title
// the PHP script is changing title after what cookie-value you have
alert($("title", data).text())
}