I'm building a debug script that is to be included at the top of my index.php
I would like to provide a checkbox that when checked, disables all javascript, jquery etc on the page.
I'm saving these settings with $_SESSION
I've already found a soloution that replaces all <script></script>
tags with <!--<script></script>-->
. But would like to know if there is anthing cleaner, more specific.
Since the file is included at the top of my index, could I write something in javascript to unbind any events/listeners/triggers etc?
I would prefer not to change any of my javascript, as the idea is to include this at the top of each project/build as a standalone piece. Thanks!