title: Edit Javascript by loading/opening the page
body: <p>PHP's DOMDocument class allows you to load an html file, make changes to the elements, and then save it. This way we can change millions of webpages by just running a little script on every file there is. I want to know that is there a way to change the javascript code thats embedded on the page? </p>
  
  <p>I developed an application that generates web pages, and I have been using it for months now. There are like 800 pages I have created so far. Now I have come to know that there was a small error in my javascript code and I want to correct it. The obvious solution is to open every single file and make the changes manually. Do I have any other chioce that is simple?</p>
  
  <p>below is the javascript that is currently embedded on the page</p>
  
  <pre><code>var actNum='';
  $.ajax({
  
         url:'DBOperations.php', 
         type: 'POST',
         async: 'false',
         data: {Command:'GET_ACTIVITY_NUMBER_DB', Title:'English/Level 1/Chapter 1/act 1'}, 
          success: function(value){   
                                      if(value)
                                      {
                                          actNum=value;
                                          document.getElementById('actNumDiv').appendChild(document.createTextNode(value));
                                      }
                   }
  
         });
  </code></pre>
  
  <p>I want to send an extra variable "type" next to "Title" in the ajax call like this</p>
  
  <pre><code> data: {Command:'GET_ACTIVITY_NUMBER_DB', Title:'English/Level 1/Chapter 1/act 1', type:'admin'}
  </code></pre>