title: Call PHP Function using jQuery AJAX
body: <p>I've read all the topics about my question but cannot solve my problem.
  I want to get php function result using jQuery AJAX.</p>
  
  <p>function.php</p>
  
  <pre><code>function generateCode() {
  //code here
  }
  
  function generateResult() {
  //code here
  }
  </code></pre>
  
  <p>How can I catch the function result using jQuery AJAX? I don't want to  change function.php structure because it related to another pages.</p>
  
  <p>Refer to <a href="https://stackoverflow.com/questions/2269307/using-jquery-ajax-to-call-a-php-function">using jquery $.ajax to call a PHP function</a>, no answer can solve my problem.
  Thank You</p>