Salve, premetto che non sono pratico di javascript quindi scusatemi se vi sottopongo questioni troppo banali.
Volevo realizzare una piccola finestrella pop-up con alcuni dati all'interno, per questo ho usato una funzione autoPopup() modificata da una delle guide di HTML.it; ho inserito la funzione modificata in un file .js esterno e lo importo prima di richiamarla nell'html di prova ma non funge. Eccovi le porzioni di codice di interesse:

Pagina .html di prova (riporto solo le cose essenziali)
Codice PHP:
<script type="text/javascript" src="/postitmenu/popup.js"></script>
[url="javascript:autoPopup()"]Post-it[/url] 
file .js contenente la funzione autoPopup() (riporto solo le cose essenziali)

Codice PHP:
function autoPopup() {
    var stili = "top=10, left=10, width=400, height=250, status=no, menubar=no, toolbar=no scrollbar=no";
      var testo = window.open("", "", stili);

    testo.document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
    
testo.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n");
    
testo.document.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" xml:lang="it">\n");

    
testo.document.write("\t<head>\n");
          
testo.document.write("\t\t<title>Post-it</title>\n");
    
testo.document.write("\t\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"css/popstyle.css\" />\n");
          
testo.document.write("\t</head>\n");

          
testo.document.write("\t<body>\n");
    
testo.document.write("bla bla");
          
testo.document.write("\t</body>\n");

          
testo.document.write("</html>");
}
Cosa sbaglio?