JavaScript Problem: Passing a JavaScript Value Between HTML Pages



In this tutorial we are going to look at passing a value from one HTML page to another. We will use two techniques: localstorage and the query string. The value we are going to pass is the number of milliseconds so that we can determine elapsed time.

For more resources on JavaScript:
http://www.allthingsjavascript.com

Access to EVERY course (get 2 months free): https://www.skillshare.com/r/profile/Steven-Hancock/24508

Courses offered on Udemy at a discount (access from my site): http://allthingsjavascript.com/courses.html

Tutorials referred to in this video:
local storage: https://youtu.be/CsoknB_0TW8
indexedDB: https://youtu.be/g4U5WRzHitM
coersion: https://youtu.be/z4-8wMSPJyI
Formatting Time with Date object: https://youtu.be/j8katkbMVhs
Tracking Elapsed Time: https://youtu.be/knbUg0Q3qLU
Determining Days Between Dates: https://youtu.be/uWQEGgNvac0

#javascript #AllThingsJavaScriptLLC

Original source

13 thoughts on “JavaScript Problem: Passing a JavaScript Value Between HTML Pages

  • May 16, 2020 at 08:52
    Permalink

    Hello sir, Awesome tutorial 🙂 I have a doubt
    @10:31 in line 12 instead of function(){init();} i did init() directly and it is not working and what s the difference between the two.

    I am pretty new to js i started just today so I don't understand the difference

  • May 16, 2020 at 08:52
    Permalink

    I'm having trouble getting the technique to work. I want once the script is executed for the other page to be permanently edited, is there a way to do that with this technique or is that not possible?

  • May 16, 2020 at 08:52
    Permalink

    Good video but i have any question. We can't change the value propertye from a html element? For example: var htmlElement = document.getElementById("idElement"); htmlElement.value = "someValue";
    It didn't work for me as it did work before.

  • May 16, 2020 at 08:52
    Permalink

    This video was really useful! I tried with erb file instead of html, but it did not work… It worked fine with html files. Would be very nice if you let me know how to fix it!

  • May 16, 2020 at 08:52
    Permalink

    About the replacing with regex: Is there nothing less costly, like splitting or find and slice in Python?

Leave a Reply