[BACK]Return to index.html CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo-REST-API / example / htdocs

File: [local] / todotxt / Text-Todo-REST-API / example / htdocs / index.html (download) (as text)

Revision 1.6, Sun Jan 31 03:40:21 2010 UTC (14 years, 5 months ago) by andrew
Branch: MAIN
Changes since 1.5: +10 -9 lines

cleanup, s{/entry/}{/}

<html><head>
<!-- $AFresh1: index.html,v 1.6 2010/01/31 03:40:21 andrew Exp $ -->
<title>todo.txt - ajax client</title>
<link rel="stylesheet" href="todo.css">
<!-- <script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> -->
<script src="dojo/1.4/dojo/dojo.xd.js"></script>
<script type='text/javascript'>
var base_url = '/~andrew/user-bin/todo.cgi';

function loadIntoNode(data, xhr){
  if(xhr.args.node){
    xhr.args.node.innerHTML = data;
  }
}

function getFiles() {
  dojo.byId('files').innerHTML = "Getting Files . . .";
  dojo.xhrGet({
    url: base_url, 
    node: dojo.byId("files"),
    load: loadIntoNode
  });

}
function getList(list) {
  dojo.byId('list').innerHTML = "Getting List . . .";
  dojo.xhrGet({
    url: base_url + '/' + list + '.txt',
    node: dojo.byId("list"),
    load: loadIntoNode
  });
}
function getEntry(list, entry) {
  document.getElementById('entry').innerHTML = "Getting Entry . . .";
  dojo.xhrGet({
    url: base_url + '/' + list + '/' + entry + '.md5',
    node: dojo.byId("entry"),
    load: loadIntoNode
  });
}
</script>
</head>

<body onLoad="getFiles();getList('todo');getEntry('todo',5)">
<div id='files'></div>
<div id='entry'></div>
<pre><div id='list'></div></pre>
</body></html>