phpWhitespaceTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require_once("../xajax.inc.php");
  3. function showOutput()
  4. {
  5. $objResponse = new xajaxResponse();
  6. $objResponse->addAlert("Hello");
  7. return $objResponse;
  8. }
  9. $xajax = new xajax();
  10. //$xajax->debugOn();
  11. $xajax->registerFunction("showOutput");
  12. $xajax->processRequests();
  13. ?>
  14. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  15. "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml">
  17. <head>
  18. <title>PHP Whitespace Test | xajax Tests</title>
  19. <?php $xajax->printJavascript("../") ?>
  20. </head>
  21. <body>
  22. <h2><a href="index.php">xajax Tests</a></h2>
  23. <h1>PHP Whitespace Test</h1>
  24. <p><em>This tests what happens when there's whitespace before the &lt;?php token in the PHP file (thus possibly causing the XML response to be invalid).</p>
  25. <form id="testForm1" onsubmit="return false;">
  26. <p><input type="submit" value="Test Whitespace" onclick="xajax_showOutput(); return false;" /></p>
  27. </form>
  28. <div id="submittedDiv"></div>
  29. </body>
  30. </html>