Posts

Showing posts with the label interaction

PHP to Jaxer Server And Vice-Versa

Basis If we have a configuration Jaxer + PHP, as is as example in my pampa-j project , we should know that these two languages cannot directly interact as is, for example, with Jaxer and Java. The interpreted and executed order is this one: the PHP module parses the request and the page before Jaxer module after PHP has finished its stuff, the Jaxer Server module parses the page which could has been modified during PHP execution after the Jaxer Server has finished its stuff, the user receives the generated page Above order means that we can pass variables to Jaxer but we cannot pass back results to PHP <?php // simple variable from PHP to Jaxer $myVar = 'Hello World'; echo '<script runat="server"> myPHPVar = '.json_encode($myVar).'; onload = function(){ // will show Hello World document.body.innerHTML = myPHPVar; }; </script>'; ?> As summary, if we print out a script tag wth a valid JavaScript for server, c...