[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.2, Mon Jan 18 04:51:15 2010 UTC (14 years, 5 months ago) by andrew
Branch: MAIN
Changes since 1.1: +40 -1 lines

wow, that is SOOOO kewl that it works like that!

<html><head>
<title>todo.txt - javascript client</title>
<script src="prototype.js" type="text/javascript"></script>
<script type='text/javascript'>
function getFiles() {
	document.getElementById('files').innerHTML = "Getting Files . . .";
	new Ajax.Request('/~andrew/user-bin/todo.cgi/andrew.txt', {
		method: 'get',
  		onSuccess: function(response) {
   			 document.getElementById('files').innerHTML = response.responseText;
  		}
	});
}
function getList(list) {
	document.getElementById('list').innerHTML = "Getting List . . .";
	new Ajax.Request('/~andrew/user-bin/todo.cgi/andrew/' + list + '.txt', {
		method: 'get',
  		onSuccess: function(response) {
   			 document.getElementById('list').innerHTML = 
			'<pre>' + response.responseText + '</pre>';
  		}
	});
}
function getEntry(list, entry) {
	document.getElementById('entry').innerHTML = "Getting Entry . . .";
	new Ajax.Request('/~andrew/user-bin/todo.cgi/andrew/' + list + '/entry/' + entry + '.md5', {
		method: 'get',
  		onSuccess: function(response) {
   			 document.getElementById('entry').innerHTML = 
			'<pre>' + response.responseText + '</pre>';
  		}
	});
}
</script>
</head>
<body onLoad="getFiles();getList('todo');getEntry('todo',5)">
<!-- $AFresh1: index.html,v 1.2 2010/01/18 04:51:15 andrew Exp $ -->
<div id='files'></div>
<div id='list'></div>
<div id='entry'></div>
</body></html>