Skip to content

Instantly share code, notes, and snippets.

@dhavaln
Created July 10, 2012 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhavaln/3084731 to your computer and use it in GitHub Desktop.
Save dhavaln/3084731 to your computer and use it in GitHub Desktop.
Cordova 1.7 Remote Test
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
var serviceURL = 'http://salespump.pumpstationstudios.com/app/services/';
var employees;
function getEmployeeList() {
$.getJSON(serviceURL + 'getemployees.php', function(data) {
$('#employeeList li').remove();
employees = data.items;
$.each(employees, function(index, employee) {
$('#employeeList').append('<li><a href="employeedetails.html?id=' + employee.id + '">' +
'<img src="' + employee.image + '"/>' +
'<h4>' + employee.fullname + '</h4>' +
'<p>' + employee.title + '</p>' +
'<span class="ui-li-count">' + employee.reportCount + '</span></a></li>');
$('#employeeList').listview('refresh');
});
});
}
</script>
</head>
<body>
<div data-role="page" id="employeeListPage">
<ul id="employeeList" data-role="listview">
</ul>
</div>
</body>
<script type="text/javascript">
$('#employeeListPage').bind('pageinit', function(event) {
getEmployeeList();
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment