可能重复:
如何在 jQM 页面之间存储变量?
我是 jquery mobile 的新手,对将数据发送到另一个页面有点困惑。在我的 html 文件中,它由 listview 组成。当我单击列表时,它需要重定向到另一个页面,同时我想将该列表中的数据发送到第二页。其实我的代码是..
民意调查.html
<body>
<section id="pollsscreen" data-role="page">
<header data-role="header" >
<h1> Video </h1>
<a href="index.html" data-role="button" data-icon="back" data-direction="reverse" data-transition="slide"> Back </a>
</header>
<div data-role="content">
<ul id="pollslist" data-role="listview" data-theme="e" >
</ul>
</div>
</section>
</body>
Polls.js(我的 javascript 文件)
var addPollsList = function addPollsList() {
$("#pollslist").prepend("<li><a href='pollsdetails.html'>What is your name?</a></li>");
$("#pollslist").prepend("<li><a href='pollsdetails.html'>Give review of new movie..</a></li>");
$("#pollslist").listview("refresh");
}
pollsdetails.html
<section id="pollsdetailspage" data-role="page">
<header data-role="header">
<h1> Polls </h1>
<a href="polls.html" data-role="button" data-icon="back" data-direction="reverse" data-transition="slide"> Back </a>
</header>
<div data-role="content" class="pollsdetailsscreen">
<p>Polls details page</p>
</div>
</section>
</body>
根据代码,一切正常。当我单击列表时,它会重定向到“pollsdetails.html”文件。但是在这里我不知道如何将数据发送到该 html 页面,我想将该数据设置为
pollsdetails.html 页面中的标记。谁能帮我这个.......
提前致谢...