我目前正在使用 jQuery Mobile 和 PhoneGap 创建一个应用程序作为辅助项目。此应用程序将显示多张图像,并让用户有机会收藏他/她喜欢的图像。一旦用户单击按钮收藏图像,该图像将显示在收藏页面 (favorite.html) 上。我无法使用本地存储来合并此任务。甚至可以将图像存储和检索到另一个页面吗?任何帮助都会很棒。如果您需要视觉效果,下面是我的 jsfiddle 的链接。
<!-- Page One -->
<div data-role="page" id="one">
<div data-role="header">
<h1>Page 1</h1>
</div>
<div data-role="main">
<img src="https://www.petfinder.com/wp-content/uploads/2012/11/140272627-grooming-needs-senior-cat-632x475.jpg" style="width: 100px;"/>
<br />
<button id="favcat">Click Here to Favorite Cat Image!</button>
<br />
<br />
<img src="http://www.dogslovewagtime.com/wp-content/uploads/2015/07/Dog-Pictures.jpg" style="width: 100px;" />
<br />
<button id="favdog">Click Here to Favorite Dog Image!</button>
</div>
</div>
<!--Page Two -->
<div data-role="page" id="two">
<div data-role="header">
<h1>Page 2: Stored and Retrieved Images Display On This Page Once Clicked</h1>
</div>
<div data-role="main">
</div>
</div>