title: When I include <script> tags in another PHP file the javascript code doesn't work properly
body: <p>I've been stuck on this issue for a while now. Maybe some of you programming geniuses can help me out.</p>
  
  <p>So I am working with 6 files: </p>
  
  <ol>
  <li>BASE_URL/header.php</li>
  <li>BASE_URL/footer.php</li>
  <li>BASE_URL/includes/notifications.php</li>
  <li>BASE_URL/includes/wall.php</li>
  <li>BASE_URL/javascript1.js</li>
  <li><p>BASE_URL/javascript2.js</p>
  
  <p>The header.php file includes the  tag for javascript1.js.</p>
  
  <p>The footer.php file includes the  tag for javascript2.js.</p>
  
  <p>The notifications.php file gets the messages and alerts and has some html in it and calls a function from the wall.php.</p>
  
  <p>The wall.php file gets the messages from the database and has some html in it.</p>
  
  <p>The javascript1.js file has some ajax that refers to the notifications.php</p>
  
  <p>The javascript2.js file has some javascript.</p></li>
  </ol>
  
  <p>Everything works fine. Except that the javascript code in my javascript2.js file doesn't seem to be working. And when I include the  tag within the notifications.php file it causes some errors please help. </p>
  
  <p>Here is the code for the javascript1.js</p>
  
  <pre><code>/*---------------- popoup message notifications -----------------*/
  jQuery(document).ready(function()
  {/* this function will be available after the document is loaded */
  
      /* declare the message notification variables */
      var messagesIcon    = $('.page_header_messages_icon');
      var messagesInboxList   = $('.messages_popup_box_inbox_list');
  
      /* declare the ajaxAutoAlerts variable */
      var ajaxAutoAlerts;
  
      /* call the autoLoadMessages function */
      autoLoadMessages();
  
      messagesIcon.click(function(event)
      {/* when the messagesIcon is clicked */
  
          /* show the ajax loader */              
          jQuery(messagesInboxList).html("&lt;div class='load_notifications' align='center'&gt;&lt;img src='"+site_url+"img/ajax-loader.gif' /&gt;&lt;/div&gt;"); 
  
          var dataString = 't=alrt';
  
          jQuery.ajax({
              type: "POST",
              url: site_url+"includes/message_notifications.php",
              data: dataString,
              cache: false,
              success: function(response){
  
                  jQuery(messagesInboxList).html("");
                  jQuery(messagesInboxList).html(response);
  
                  /* resize nicescroll everytime an element using nicescroll is shown/hidden */ 
                  niceScrollVariable.getNiceScroll().resize();
              }
          });
      });
  });
  </code></pre>