function AddBookmark() { // get the personal toolbar folder, which'll be constructed // automagically by RDF var folder = document.getElementById("NC:PersonalToolbarFolder"); dump("folder = " + folder + "\n"); if (folder == null) return; var treechildren = null; for (var i = folder.childNodes.length - 1; i >= 0; --i) { dump('folder.childNodes[' + i + '].nodeName = ' + folder.childNodes[i].nodeName + '\n'); if (folder.childNodes[i].nodeName == 'treechildren') { treechildren = folder.childNodes[i]; break; } } dump("treechildren = " + treechildren + "\n"); if (treechildren == null) { treechildren = document.createElement('treechildren'); folder.appendChild(treechildren); } var newItem = document.createElement('treeitem'); newItem.setAttribute('id', 'http://home.netscape.com/people/waterson'); newItem.setAttribute('type', 'http://home.netscape.com/NC-rdf#Bookmark'); newItem.setAttribute('nc:Name', 'My Home Page'); newItem.setAttribute('rdf:property', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#_5'); treechildren.appendChild(newItem); } Add Bookmark Name URL