html - Javascript: is it possible to read the raw code of external scripts? -


given typical script tag:

<script src="foo.com/myscript.js"></script> 

would possible directly read contents of myscript.js string or something?
example:

<script id="myscript" src="foo.com/myscript.js"></script> <script>     var inners = document.getelementbyid("myscript").//raw contents of myscript.js </script> 

no. can read contents of inline script tag, because have content:

<script id="myscript">   var inners = document.getelementbyid("myscript").textcontent; </script> 

but external js, script contents not put dom; need re-fetch using ajax (it cached unless anti-caching measures taken, not take time re-fetch).


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -