Avatar of RupertA
RupertA
Flag for United Kingdom of Great Britain and Northern Ireland asked on

transfer data from one html page to another html page

Hi there, this may be very easy so please humour my ignorance. I have a situation where I need to pass data in my "notes" variable to another html page and pick it up in a javascript variable on the new html screen. Usually I would send the data to a PHP file and use "GET" to obtain the data. No problems. But just found out PHP is not going to be installed. So I need to do something else.

I was thinking of using one of these two types of ways to submit data from notes to pdfcreate.html.

var notes =  player.GetVar("TextEntry1");
window.location.href = "jsPDF/mod1/pdfcreate.html?" + notes;

or

var notes = player.GetVar("TextEntry1");
window.open("jsPDF/mod1/pdfcreate.html?notesinput="+notes,"_newtab");

The question is on pdfcreate.html, how can I get the data received (notes) into a javascript variable? Thanks. If anyone can give me some code that would be great.
JavaScriptHTMLWeb DevelopmentWeb Languages and StandardsScripting Languages

Avatar of undefined
Last Comment
RupertA

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RupertA

ASKER
Ok, so in your example, how do I use javascript on page.html to get the query string (some_data_here)? Thanks. It is just one variable I am sending, not multiple.
RupertA

ASKER
so, far I am finding something like this to be OK. will need to test it further.


test1.html
arnold

That is one wy, setting a cookie with the data and then retrieveing it .

you can set one that identifies the variable, another that has the data.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
RupertA

ASKER
Thanks arnold, my function was working nicely to retrieve the date from the previous screen. Thanks.