Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

pass javascriot value from one page to another

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);
Comment

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;
}
Comment

how to pass the data from one page to another in javascript

var favoritemovie = "Shrek";
sessionStorage.setItem("favoriteMovie", favoritemovie);
Comment

pass javascriot value from one page to another

var b = localStorage.getItem("myValue");
alert("The Value Received is " + b);
var resetValue =0;
localStorage.setItem("myValue", resetValue);
Comment

send data to another page javascript

postMessage: exchange data between different domains
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript toisostring without milliseconds 
Javascript :: jquery form serialize object 
Javascript :: react select with custom option 
Javascript :: find input by value attribute javascript 
Javascript :: js remove html element 
Javascript :: sticky footer react 
Javascript :: get home dir in nodejs 
Javascript :: javascript today date in epoch 
Javascript :: javascript random number between 20 and 30 
Javascript :: suspense react 
Javascript :: .textcontent in javascript 
Javascript :: detect iframe content change javascript 
Javascript :: converting strings to numbers 
Javascript :: reset div jquery 
Javascript :: js click anchor 
Javascript :: how to get thumbnail image from video file in javascript 
Javascript :: js capitalize first letter of each word 
Javascript :: remove duplicates from array of objects 
Javascript :: Delete Properties from a JavaScript Object 
Javascript :: counts the duplicates in an array using for loop 
Javascript :: what is interpolatin in javascript 
Javascript :: react router dom private route 
Javascript :: get date in specific timezone 
Javascript :: javascript convert image to base64 
Javascript :: iife js arrow function 
Javascript :: react slick 
Javascript :: nextjs global scss variables 
Javascript :: laravel http send data json raw 
Javascript :: get element by id jqueryt 
Javascript :: array contains method 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =