TypeError: Result of expression 'rs' [undefined] is not an object

Hi,

I have been playing with html5 databases (I debated weather this should go here as it is implemented with JavaScript or in HTML and XHTML forum). I have been getting this error, does anyone know what causes this?

TypeError: Result of expression 'rs' [undefined] is not an object.

Here’s the function the error applied to:

		function renderTodo(tx, rs)
		{
			e = $('#newtodo');
			e.html("");
			for(var i=0; i < rs.rows.length; i++)
			{
				r = rs.rows.item(i);
				e.html(e.html() + 'id: ' + r['id'] + ', title: ' + r['title'] + ', notes: ' + r['notes'] + '<br />');
			}
		}

and to this line of the function:

for(var i=0; i < rs.rows.length; i++)

Has anyone go any suggestions they would care to share?

Help would be much appreciated.
Dan.

Where does the value of rs come from? What do you pass in the function call?

OK, thanks for that. In itself that was enough for me to realise I had called the wrong function (helps if I use the right one! duh!). I was calling this function that renders the results, rather than calling the one which gets the results that in turns calls the function that renders that results.

Anyhow, thanks for the prompt.