Napisałem poniższą funkcję. Wszystko jest ładnie z dodawaniem appendChild. Za każdym razem jak najadę na odnośnik to dane są wyśietlane na warstwie, lecze próbuję od dłuższego czasu zrobić tak, żeby wyświetlane dane po najechaniu na odnośnik nie duplikowały się w wyświetlaniu. Stwierdziłem, że użyję removeChild jak poniżej. Niestety remove nie chcę załapać, poproszę o pomoc w tej robnej kwestii:
function js_showData(div_name,num,div_city,div_object) { var div = null; var city = null; var obj_name = null; var v0 = null; var v1 = null; var v2 = null; var v3 = null; div = document.getElementById(div_name); city = document.getElementById(div_city); obj_name = document.getElementById(div_object); var advert_num = num; if(num == null) { num = 0; } /* div.style.width=200; div.style.height=200; div.style.backgroundColor="black"; div.style.color="white"; */ if(js_object_name[num]!=null) { v0 = document.createTextNode(js_id_adv[num]+" "); v1 = document.createTextNode(js_object_name[num]+" "); v2 = document.createTextNode(js_city[num]+" "); v3 = document.createTextNode(js_area[num]+" "); obj_name.appendChild(v1); city.appendChild(v2); div.appendChild(v3); div_object.removeChild(v2.lastChild); } }