How to check if a page has any <script> elements in JavaScript

1 Answer

0 votes
var scripts = document.scripts;

if (scripts.length) 
  document.write("This page has " + scripts.length + " scripts");


/*
run:

This page has 1 scripts  

*/

 



answered Jun 11, 2016 by avibootz

Related questions

...