如何使用jQuery在两个html页面之间传递变量?
的file1.html
<form>
First name : <input type="text" id="firstname"/>
</form>
file2.html:
<p> <!--retrieve firstname here --> </p>
答案 0 :(得分:0)
您可以使用localStorage:
// Store (on first page)
localStorage.setItem("firstname", "Smith");
// Retrieve (on second page)
var firstname = localStorage.getItem("firstname");