[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.4, Sun Jan 31 02:31:47 2010 UTC (14 years, 5 months ago) by andrew
Branch: MAIN
Changes since 1.3: +29 -21 lines

no more prototype.js, use dojo instead, cuZ it is more like WebOS

<html><head>
<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 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/' + entry + '.md5',
    node: dojo.byId("entry"),
    load: loadIntoNode
  });
}
</script>
</head>
<body onLoad="getFiles();getList('todo');getEntry('todo',5)">

<!-- $AFresh1: index.html,v 1.4 2010/01/31 02:31:47 andrew Exp $ -->
<div id='files'></div>
<pre><div id='list'></div></pre>
<div id='entry'></div>
</body></html>