jpush-phonegap-plugin/example/index.html
2014-06-04 13:20:24 +08:00

97 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Phonegap Sample App</title>
<link href="css/jquery.mobile-1.1.1.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.1.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
var onDeviceReady = function() {
console.log("Device ready!")
initiateUI();
}
var initiateUI = function() {
$("#setTagWithAliasButton").click(function(ev) {
console.log("tap set tag/alias button!");
try{
var tag1 = $("#tagText1").attr("value");
console.log("tag1:"+tag1);
window.plugins.jPushPlugin.setTagsWithAlias("myTags","myTags1","myTags2","myAlias");
}
catch(exception){
console.log(exception);
}
})
}
document.addEventListener("deviceready", onDeviceReady, false)
</script>
</head>
<body>
<div data-role="page" id="page">
<div data-role="header" class="ui-bar ui-bar-b">
<center>
<img border="0" src="img/logo.png" alt="Urban Airship" align="center" />
</center>
</div>
<div data-role="content">
<form>
<div class="ui-body ui-body-b">
<div data-role="fieldcontain">
<center><h3>JPushPlugin Example</h3></center>
<span name="alias" id="alias"></span><hr />
</div>
<div data-role="fieldcontain">
<label>Tags: </label>
<table>
<tr>
<td>
<input type="text" id="tagText1"/>
</td>
</tr>
<tr>
<td>
<input type="text" id="tagText2"/>
</td>
</tr>
<tr>
<td>
<input type="text" id="tagText3">
</td>
</tr>
</table>
<label>Alias: </label>
<table>
<tr>
<td>
<input type="text" id="aliasText">
</td>
</tr>
</table>
</div>
<div data-role="fieldcontain">
<input type="button" id="setTagWithAliasButton" value="Add tag and alias" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>