-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
  • 63,850
  • 5
  • 53
  • 80
msg
  • 1,239
  • 3
  • 17
  • 25

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
  • 640
  • 7
  • 21