Hi everyone!

I'm trying to view some content in a window but each time I run the function
the content adds to the last content.
HTML Code:
function view(){
var  viewstate=window.open('','view','height=400,width=600,top=0,left=0,toolbar=0,scrollbars=auto,location=0,statusbar=0,menubar=0,resizable=1');
viewstate.document.open();
viewstate.document.clear();
with(viewstate.document){
    write('<html>\n<head><title>View variables</title></head>\n\n<body>');
							
    for(uk=0; uk<10; uk++){
       for(mk=0; mk<10; mk++)
          auxstring=auxstring+auxarray[uk][mk]+' ';	
          auxstring=auxstring+'<br>';
}
write(auxstring);
write('</body>\n</html>');
}
viewstate.document.close();
}
the line viewstate.document.clear(); seems doesn't work. any idea?

SOLVED

HTML Code:
function view(){
var  viewstate=window.open('','view','height=400,width=600,top=0,left=0,toolbar=0,scrollbars=auto,location=0,statusbar=0,menubar=0,resizable=1');
viewstate.document.open();
with(viewstate.document){
    write('<html>\n<head><title>View variables</title></head>\n\n<body>');
    auxstring='';					
    for(uk=0; uk<10; uk++){
       for(mk=0; mk<10; mk++)
          auxstring=auxstring+auxarray[uk][mk]+' ';	
          auxstring=auxstring+'<br>';
}
write(auxstring);
write('</body>\n</html>');
}
viewstate.document.close();