如何通过在Android的PhoneGap的应用参数 [英] How to pass parameters in android phonegap application

查看:106
本文介绍了如何通过在Android的PhoneGap的应用参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是第一次,我想我的手在Android上的PhoneGap application.For同我设计一个示例应用程序在那里我从一个传递一些参数 HTML 页另一个。这里是HTML我的第一页。

For the first time i am trying my hand On Android Phonegap application.For the same i am designing a sample application where i have to pass some parameters from one HTML page to another .Here is the HTML for my first page ..

<div class="choice_list"> 
<ul data-role="listview" data-inset="true" data-filter="true">
<li><a href="empdetails.html" data-transition="slidedown"> <img src="images/will.jpg"/> <h3> Will Smith </h3></a></li>
</ul>   
</div>

现在按我的要求我必须通过&LT; H3&GT; 参数,我的下一个HTML页面即 empdetails.html 键,只要链接按钮被点击显示它有..

Now as per my requirement i have to pass the <h3> parameter to my next HTML page i.e empdetails.html and display it there as soon as the link button gets clicked..

下面是我的 empdetails.html HTML ..

Here is my empdetails.html HTML..

<div id="header2">
    <h2>Name: "I need to show name here"</h2>
</div>

请帮我拿到这个..我很新的这个.. 谢谢..

Please help me to get this ..I am very new in this .. Thanks ..

推荐答案

您可以在PhoneGap的使用本地存储(第一页组)

You can use local storage in phonegap (set on first page)

  window.localStorage.setItem("key", $("h3").text());

有关获得本地存储的使用(在第二页中设置)

For get the local storage use(set on second page)

var data=window.localStorage.getItem("key");

这篇关于如何通过在Android的PhoneGap的应用参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆