SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict dgroves's Avatar
    Join Date
    Jan 2007
    Location
    Bath, UK
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

    Code:
    TypeError: Result of expression 'rs' [undefined] is not an object.
    Here's the function the error applied to:

    Code JavaScript:
    		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:
    Code JavaScript:
    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.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Where does the value of rs come from? What do you pass in the function call?

  3. #3
    SitePoint Addict dgroves's Avatar
    Join Date
    Jan 2007
    Location
    Bath, UK
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •