Skip to content

Instantly share code, notes, and snippets.

@jesuino
Created December 31, 2014 05:47
Show Gist options
  • Select an option

  • Save jesuino/0c7c9cd743d0d3effaf0 to your computer and use it in GitHub Desktop.

Select an option

Save jesuino/0c7c9cd743d0d3effaf0 to your computer and use it in GitHub Desktop.
Simple page to use the generated API
<html>
<head>
<script src="./bpms-js" type="text/javascript">
</script>
<script type="text/javascript">
function loadTasks() {
var tasks_resp = TaskResource.query({ownerId: "jesuino", $accepts: "application/json"});
var tasks = tasks_resp.list;
var tasksHTML = "";
// alert(JSON.stringify(tasks));
for(var i = 0; i < tasks.length; i++) {
var t = tasks[i];
tasksHTML += "<li>Name: " + t.name + ", created by: " + t.createdById +"</li>"
}
document.getElementById("numberTasks").innerHTML = tasks.length;
document.getElementById("listTasks").innerHTML = tasksHTML;
}
function startTask() {
}
//loadTasks();
</script>
</head>
<body onload="loadTasks()">
<h2>Tasks for user Jesuino</h2>
<p>Number of tasks: <span id="numberTasks" /> </p>
<br />
<ul id="listTasks">
</ul>
</body>
<html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment