title: How to check for a script dependency?
body: <p>The question I need to ask is How to check for the dependency of a script on my website? Why I need to do this is following:</p>
  
  <p>I'm working on updation of an existing website of a customer, I have to improve the performance of the website as well, the problem is the website has many unused scripts accompanied with it (i.e. most of them are there but there functionality isn't being used) that are increasing the load time of the website and to remove them, I don't know how to check for the unnecessary scripts.</p>
  
  <p>So my question is, Is there any way that I can check what are the scripts that are unnecessary for the website and removing them won't break the functionality of website?</p>
  
  <p>Here are the "bunch" of scripts that they have used and I'm pretty sure most of them are unnecessary but I can't take the risk of removing them as there are about 100 pages on which these are used. The fact that I can say most of them are unnecessary is because of the quality of their own written scripts plus there are other flags for that as well.</p>
  
  <pre><code>&lt;!-- jQuery --&gt;
  &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!-- jQuery UI --&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.core.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.widget.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.mouse.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.draggable.min.js"&gt;&lt;/script&gt;
  &lt;link href="css/plugins/jquery-ui/smoothness/jquery.ui.theme.css" rel="stylesheet"
      type="text/css" /&gt;
  &lt;!-- Touch enable for jquery UI --&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.core.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.widget.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.sortable.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery.ui.resizable.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/touch-punch/jquery.touch-punch.min.js"&gt;&lt;/script&gt;
  &lt;!-- slimScroll --&gt;
  &lt;script src="js/plugins/slimscroll/jquery.slimscroll.min.js"&gt;&lt;/script&gt;
  &lt;!-- Bootstrap --&gt;
  &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/validation/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/validation/additional-methods.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!-- vmap --&gt;
  &lt;script src="js/plugins/vmap/jquery.vmap.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/vmap/jquery.vmap.world.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/vmap/jquery.vmap.sampledata.js"&gt;&lt;/script&gt;
  &lt;link href="css/plugins/icheck/skins/square/blue.css" rel="stylesheet" type="text/css" /&gt;
  &lt;!-- Bootbox --&gt;
  &lt;script src="js/plugins/bootbox/jquery.bootbox.js"&gt;&lt;/script&gt;
  &lt;!-- Flot --&gt;
  &lt;script src="js/plugins/flot/jquery.flot.min.js"&gt;&lt;/script&gt;
  &lt;%-- &lt;script src="js/plugins/flot/jquery.flot.bar.order.min.js"&gt;&lt;/script&gt;--%&gt;
  &lt;script src="js/plugins/flot/jquery.flot.pie.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/flot/jquery.flot.resize.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/flot/jquery.flot.stack.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!-- imagesLoaded --&gt;
  &lt;script src="js/plugins/imagesLoaded/jquery.imagesloaded.min.js"&gt;&lt;/script&gt;
  &lt;!-- PageGuide --&gt;
  &lt;script src="js/plugins/pageguide/jquery.pageguide.js"&gt;&lt;/script&gt;
  &lt;!-- FullCalendar --&gt;
  &lt;script src="js/plugins/fullcalendar/fullcalendar.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/chosen/chosen.jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!-- Theme framework --&gt;
  &lt;script src="js/plugins/icheck/jquery.icheck.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!-- Theme scripts --&gt;
  &lt;script src="js/plugins/datatable/jquery.dataTables.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="js/application.min.js"&gt;&lt;/script&gt;
  &lt;!-- Just for demonstration --&gt;
  &lt;script src="js/select2.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/demonstration.min.js"&gt;&lt;/script&gt;
  &lt;!-- Favicon --&gt;
  &lt;link rel="shortcut icon" href="css/images/logo.png" /&gt;
  &lt;!-- Apple devices Homescreen icon --&gt;
  &lt;link href="Resources/Plugins/smartPaginator/smartpaginator.css" rel="stylesheet" /&gt;
  &lt;script src="Resources/Plugins/smartPaginator/smartpaginator.js"&gt;&lt;/script&gt;
  &lt;script src="Resources/Plugins/smartPaginator/callPaginator.js"&gt;&lt;/script&gt;
  &lt;link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-precomposed.png" /&gt;
  &lt;script src="js/plugins/modernizr.custom.32549.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="js/scripts.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>