可能重複:
How-to store variable beetween jQM pages?如何使用Jquery mobile將數據從一個頁面發送到另一個頁面?
我是新來的jQuery移動和有點混亂將數據發送到另一個頁面。在我的html文件中,它由listview組成。當我點擊列表時,它需要重定向到另一個頁面,同時我想將該列表中的數據發送到第二頁。 其實我的代碼..
Polls.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」文件。但在這裏我不知道如何將數據發送到該網頁,我想在pollsdetails.html頁面將該數據設置爲
標籤。誰能幫我這個.......
在此先感謝...