Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在jquerymobile中将值从一个页面传递到另一个页面?_Jquery_Html_Jquery Mobile - Fatal编程技术网

如何在jquerymobile中将值从一个页面传递到另一个页面?

如何在jquerymobile中将值从一个页面传递到另一个页面?,jquery,html,jquery-mobile,Jquery,Html,Jquery Mobile,可能重复: 我需要将值从一个html页面传递到另一个html页面。传递值的最佳方式是什么。谁能告诉我如何实现这一点。您可以通过表单、URL和会话传递变量。可以使用现有web应用程序中使用的所有方法将数据从一个页面传递到另一个页面。或者,您可以利用HTML5的本地存储,这是一种存储安全数据的现代且更快的方法 localStorage.lastname="Smith"; document.getElementById("result").innerHTML="Last name: "+ local

可能重复:


我需要将值从一个html页面传递到另一个html页面。传递值的最佳方式是什么。谁能告诉我如何实现这一点。

您可以通过表单、URL和会话传递变量。可以使用现有web应用程序中使用的所有方法将数据从一个页面传递到另一个页面。或者,您可以利用HTML5的本地存储,这是一种存储安全数据的现代且更快的方法

localStorage.lastname="Smith";
document.getElementById("result").innerHTML="Last name: "+ localStorage.lastname;
您可以在以下链接中找到有关HTML5本地存储的更多信息


您可以通过表单、URL和会话传递变量。可以使用现有web应用程序中使用的所有方法将数据从一个页面传递到另一个页面。或者,您可以利用HTML5的本地存储,这是一种存储安全数据的现代且更快的方法

localStorage.lastname="Smith";
document.getElementById("result").innerHTML="Last name: "+ localStorage.lastname;
您可以在以下链接中找到有关HTML5本地存储的更多信息


您可以使用html5本地或会话存储api跨页面存储小数据

设置会话存储上的值

window.sessionStorage.setItem('key', 'value');
并获得价值


sessionStorage.getItem'key'

您可以使用html5本地或会话存储api跨页面存储小数据

设置会话存储上的值

window.sessionStorage.setItem('key', 'value');
并获得价值

sessionStorage.getItem'key'