Is it possible?
<html> <script src="local.js> <script> // get contents of local.js file here without doing an ajax call? </script> </html>
local.js is on the same server, and I know that by making an xhr call, I can get its contents (if not in the file: //).
But, since it is already requested synchronously by the browser, its contents are known to the document, so I hope there is a way to access it? The collection of document.scripts did not help me.
Sounds like getting innerHTML (which works for scripts defined on the page)?
source share