Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:20
Show Gist options
  • Select an option

  • Save craigw/150589 to your computer and use it in GitHub Desktop.

Select an option

Save craigw/150589 to your computer and use it in GitHub Desktop.
// This is horrible, I know, but it's just a simple example.
window.onload = function() {
var addressbook = document.getElementById("addressbook");
var personList = document.createElement("ul");
for(var offset in people) {
var person = people[offset];
var personNode = document.createElement("li");
var name = document.createTextNode(person.name);
personNode.appendChild(name);
personList.appendChild(personNode);
}
addressbook.removeChild(document.getElementById("loading"));
addressbook.appendChild(personList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment