title: How to call a Javascript function from other page?
body: <p>I have 5 javascript functions index.php :</p>
  
  <p>1) <code>showMsg(); //this display 50 latest messages</code></p>
  
  <p>2) <code>showPopUpBox(); // this I use jquery to load the textbox and send button from typingMsg.php</code></p>
  
  <p>3) <code>hidePopUpBox(); // this hide pop up box</code></p>
  
  <p>4) <code>checkNewMsg(); // this will be auto reloaded every 5 sec to check if there is new message, it will show the numbers counts of total new messages.</code></p>
  
  <p>5) <code>ShowNewMsg(); // this function will be called when the user click the "show new messages" button.</code> </p>
  
  <p>After a user typing message on the text box on the pop up box then after he click "Send" button, ajax will call messagePost.php to submit the message to database, as the following code : </p>
  
  <pre><code>$(function() {
  $(".button").click(function() {
  $.ajax({
               type: "POST",
               url: "messagePost.php",
               data: dataString,
               success: function() {
                   $('textarea.expand25-75').val('');
                   showMsg(); //this is my problem
                   hidePopUpBox(); //this is my problem too
               }
          });
      return false;
  });
  });
  </code></pre>
  
  <p>As u can see from the codes above, the function of showMsg(); hidePopUpBox(); cannot be called because the functions are not on this page, my question is How to call the javascript function from different page?</p>