replace document write

replace document.write with query append