function valueSender()
{
var a=999;
localStorage.setItem("myValue", a);
window.location.href="index.html";
}
var b = localStorage.getItem("myValue");
alert("The Value Received is " + b);
var resetValue =0;
localStorage.setItem("myValue", resetValue);
//use this in page one
//where you will send data from
function testJS() {
var b = document.getElementById('name').value,
url = 'http://path_to_your_html_files/next.html?name=' + encodeURIComponent(b);
document.location.href = url;
}
//use the following code where you want to receive data
window.onload = function () {
var url = document.location.href,
params = url.split('?')[1].split('&'),
data = {}, tmp;
for (var i = 0, l = params.length; i < l; i++) {
tmp = params[i].split('=');
data[tmp[0]] = tmp[1];
}
document.getElementById('here').innerHTML = data.name;
}
var favoritemovie = "Shrek";
sessionStorage.setItem("favoriteMovie", favoritemovie);
var b = localStorage.getItem("myValue");
alert("The Value Received is " + b);
var resetValue =0;
localStorage.setItem("myValue", resetValue);
postMessage: exchange data between different domains