how to pass the data from one page to another in javascript
var favoritemovie = "Shrek";
sessionStorage.setItem("favoriteMovie", favoritemovie);
how to pass the data from one page to another in javascript
var favoritemovie = "Shrek";
sessionStorage.setItem("favoriteMovie", favoritemovie);
send data from one page to another html page in Javascript
//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;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us