I have two pages of jQuery, Page1 and Page2, and I’m able to get input in Page1.
The somval=1000$.
The page 1 user enters the somevalue. I have stored the value:
var val = somval;
Now in the second page, I need to get the result of somvalue in page 1. Of course two pages using My1.js My2.js respectively.
How do I share the values from one jQuery file to other JavaScript or how do I get the value from page1 value, to page2?
How do I tackle this?
You can redirect the user to the next page with the data in a query string, then in the second page you can parse the URL.
To redirect the user you can do this:
Then in the second page you can use a function to parse the URL query string:
This code was borrowed from here, although there are many ways to do it.
You mentioned jQuery, but correct me if I’m wrong, I don’t think it can do this.