Answers for "how to get all scripts on a page javascript"

0

how to get all scripts on a page javascript

var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
  if (scripts[i].src) {
  	console.log(i, scripts[i].src);
  } else { 
    console.log(i, scripts[i].innerHTML);
  }
Posted by: Guest on July-14-2021
0

how to get all scripts on a page javascript

var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
  if (scripts[i].src) {
  	console.log(i, scripts[i].src);
  } else { 
    console.log(i, scripts[i].innerHTML);
  }
Posted by: Guest on July-14-2021

Code answers related to "how to get all scripts on a page javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language