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 responses to “JavaScript Problem: Passing a JavaScript Value Between HTML Pages”
Awesome tutorial! Now how do you pass more than one value between pages? I am using your second method here.
I just wanted to take out the heading text of one page and show it on other html that this the heading how to do so
Thank you sir
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
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?
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 i ask how to do document.getElementByClassName("rectangle").style.transform ="translatex(+" var x name"+px)" //(1<15) +=1 i want to kill my self becus i dont know how to do
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!
Thanks man It works !! I was facing some dynamic data storage between 2 pages but you helped me out from it ….
Thumbs Up and A Subscribe for you ๐ <3
Thank you for the awesome tutorial. How to reset the elapsed time in every refresh or attempt?
This is very good! Glad to have found your channel and looking forward to more stuff! ๐
Awesome! Please post videos on js Design patterns…
About the replacing with regex: Is there nothing less costly, like splitting or find and slice in Python?