title: Modify javascript function while xajax execution
body: <p>I want to create a javascript function within a xajax function(php) and assign it in response.</p>
  
  <pre><code>&lt;?php
      require_once("Resources/xajax/xajax_core/xajax.inc.php");
      $xajax = new xajax(); 
  
      function foo()
      {
         $response = new xajaxResponse();
         // The code needed should be here...
            // Here create the javascript sintax using php and put it on the web
                // No problem creating the sintax but
                   -&gt;// how I put it on a new &lt;script&gt;&lt;/script&gt; ????
            // Here call the javascript
            $response-&gt;script('myJavascript');
  
         return $response
  
      }
  
      $xajax-&gt;configure( 'javascript URI', 'Resources/xajax/');
      $xajax-&gt;register(XAJAX_FUNCTION,"foo");
      $xajax-&gt;processRequest();
  ?&gt;
  
      &lt;html&gt;.......
  
      &lt;button onclick="xajax_foo()"&gt;&lt;/button&gt;
      ......&lt;/html&gt;
  </code></pre>
  
  <p>Don't know if I'm being clear but in short I want is that before running xajax there's no javascript and then there's a javascript and it's running. Maybe I should use two xajax responses, one to put the script into the web and another to call it... but at this point I need your help.</p>
  
  <p>Thanks for your time.</p>