rem: var authors = UL({}); while(i < found.length){ appendChildNodes(authors, LI({}, found[i].textContent)); i++; 
add: if(found.length > 0){ var authors = []; while(i < found.length){ authors.push(found[i].textContent); i++; } appendChildNodes(sidebar, P({}, 'By ' + authors.join(', '))); 
context: function showDetails(fieldname, baseurl, access_key){    var selectbox = document.getElementById("select-" + fieldname);    var sidebar = document.getElementById("sidebar-" + fieldname);    var isbn = document.getElementsByName(fieldname.split('-')[0] + '-isbn')[0];    // put the ISBN of it into the ISBN box, remember, the whole point!    isbn.value = selectbox.value;        sidebar.innerHTML = 'Fetching details...';        //go lookup the detailed stuff, parse it, and put it in here!    d=doSimpleXMLHttpRequest(baseurl + '/amazon-hack.php',         {'Service':'AWSECommerceService',         'AWSAccessKeyId': access_key,         'Operation': 'ItemLookup',         'IdType': 'ASIN',         'ItemId': selectbox.value,         'ResponseGroup': 'Large'})    d.addCallback(        function(data){            r=d.results[0].responseXML.documentElement;            replaceChildNodes(sidebar,null); /// clear 'em out!            var smallimage = r.getElementsByTagName('SmallImage');            if(smallimage.length > 0){                appendChildNodes(sidebar,                             IMG({'src':                                 smallimage.item(0).getElementsByTagName('URL').item(0).textContent}                                 ));            }            appendChildNodes(sidebar,                              P({'style': 'font-weight: bold'},                               r.getElementsByTagName('Title').item(0).textContent));            var i=0;            var found = r.getElementsByTagName('Author');             var authors = UL({});            while(i < found.length){                appendChildNodes(authors, LI({}, found[i].textContent));                i++;            }            appendChildNodes(sidebar, authors);            var otherstuff ={'Binding Type':'Binding',                              'Published On' :'PublicationDate',                              'Publisher': 'Publisher',                              'Length' : 'NumberOfPages'};            for(i in otherstuff) {                el =  r.getElementsByTagName(otherstuff[i]);                if(el.length > 0){                    appendChildNodes(sidebar,                                      P({},                                       i + ': ' + el.item(0).textContent));                }            }        });    d.addErrback(        function(data){        sidebar.innerHTML = 'ERROR: ' + data + ' This is a bug. ' + data;            });}
meta: 7995	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7995/b6b190122621a7c473868ff5ec5e7d91fdb0ff9c/booklookup.js/buggy/web/lib/booklookup.js