I am building a module for PHPVms which I wan’t to be AJAX driven. When passing an URL through the to the PHPVms website by a XMLHttpRequest, I want my module’s public function to ‘echo’ a variable to the Javascript. But phpvms send all the headers and the whole site again, even if the modules function only echoes out a variable. Is there a way to prevent phpvms to resend the whole page?
I am using the open method with GET, url and async = true. And I am receiving responseText, which I only wan’t to be an variable used in an innerHTML tag. The PHP function is just echo “blah blah blal”;
Seems like something happens when I use URL directly to the php file. The tag returns empty. Seems like I must build an independently library file. Anyone?
That will insert your module content into the div excluding all the layout.tpl code you would normally get.
Ok, that helped me alot. The php variant returns blank, but putting the action.php into the XMLHttpRequest.open method’s URL works perfect. Now the XMLHttpRequest responseText returns what I want and nothing more!