-1

I have a webpage (index.html) with a JSON object and a button. When I click the button I need to open another webpage (first.html) and send this JSON object from 1st screen to 2nd screen.

I used:

location.href = "first.html".
var myJSON = {"user" : [{"name" : "Ajay" , "age":"20"},{"name" : "Vicky" , "age":"25"}]};

And I don't need to use storage option and need pure JavaScript code. No JQuery.

jgillich
  • 71,459
  • 6
  • 57
  • 85
msg
  • 1,480
  • 3
  • 18
  • 27

1 Answers1

0

I think what you are looking for there is form submission. Have a look at: https://stackoverflow.com/a/13038218/1756598

that var myJson is not doing anything there anyways because before it gets there you have gone to another page.

Community
  • 1
  • 1
Hamster
  • 680
  • 7
  • 23