Can any document download a JavaScript?
Yes. The master document (page), or any loading document or loaded document, can have an external JavaScript tag that would load JavaScript. The loaded script content can be used to produce a new page (document). In the following example, when you click a button in the master page, the master page will produce a new page. The new page has an external JavaScript tag, which will automatically download a JavaScript. This second page has a button. When you click the button, the script loaded will produce a new page. There are three pages altogether. Each page is a document. This is the code for the master page:
" + "" + ""; function show2() { var pageTwo = document.open(); pageTwo.write(page2); pageTwo.close(); }