[whatwg] executeSql API is synchronous

On 9/25/07, Aaron Boodman <aa at google.com> wrote:
> On Sep 25, 2007 11:08 AM, Maciej Stachowiak <mjs at apple.com> wrote:
> Ah, that makes sense. A special purpose class for the rows property is
> fine with me. I don't feel that strongly about forEach and friends.

Speaking of forEach, what do you think of (pardon any syntax errors,
writing straight into gmail window):

db.forEach("SELECT * FROM pages;", function(row) {
    this.innerHTML += "<li><a href=\"" + row.url + "\">" + row.title +
"</a></li>";
}, document.getElementById("pages"))

and...

document.getElementById("pages").innerHTML = "<ul>" + db.map("SELECT *
FROM pages", function(row) {
    return "<li><a href=\"" + row.url + "\">" + row.title + "</a></li>"
}).join("") + "</ul>";

Why expose rows collection at all?

:DG<

Received on Tuesday, 25 September 2007 13:23:17 UTC