Files
harbour-core/harbour/contrib/examples/uhttpd/home/testxmldb.html
Francesco Saverio Giudice a1cb9aa400 2009-01-30 03:24 UTC+0100 Francesco Saverio Giudice (info/at/fsgiudice.com)
* harbour/contrib/examples/uhttpd/uhttpd.prg
    * Updated uHTTPD (Work in progress)
      + Added HRB caching (set #define HRB_ACTIVATE_CACHE .T. to enable)
      + Added support for Cookies
      * Formatted
      ! Renamed all public functions with uhttpd_ prefix (TOCHECK)
      + Added support for array content in POST variables
      * Optimized some code
  + harbour/contrib/examples/uhttpd/cgifunc.prg
    + Some helper function moved here from uhttpd prg and added
      some functions of mine
  + harbour/contrib/examples/uhttpd/cookie.prg
    + Cookie class
  + harbour/contrib/examples/uhttpd/modules/cookie.prg
    + cookie sample module
  + harbour/contrib/examples/uhttpd/home/postsample.html
    + POST example
  * harbour/contrib/examples/uhttpd/uhttpd.ini
    + Added new script alias for cookie sample

  * harbour/contrib/examples/uhttpd/hbmk_b32.bat
  * harbour/contrib/examples/uhttpd/home/index.html
  * harbour/contrib/examples/uhttpd/home/testxmldb.html
  * harbour/contrib/examples/uhttpd/modules/bldhrb.bat
  * harbour/contrib/examples/uhttpd/modules/info.prg
  * harbour/contrib/examples/uhttpd/modules/showcounter.prg
  * harbour/contrib/examples/uhttpd/modules/tableservletdb.prg
    * Updated for new function prefix and some formatting
2009-01-30 02:26:55 +00:00

91 lines
3.4 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Part 4 Example</title>
<meta http-equiv="Pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script type="text/javascript" src="/js/ajax.js"></script>
<script type="text/javascript">
// <![CDATA[
var divpart;
/**
* Requests table data for a specific page.
*
* @param pageNum the page number to request data for
*/
function getTableData(pageNum)
{
xslGet( "/xsl/based.xsl" );
xmlGet('/cgi-bin/tableservletdb.hrb?page=' + pageNum + "&sid=" + Math.random(), tableResponseHandler);
divpart = 'tableSection';
}
function getTablePages()
{
xslGet( "/xsl/basep.xsl" );
xmlGet('/cgi-bin/tableservletdb.hrb?count=true' + "&sid=" + Math.random(), tableResponseHandler);
divpart = 'pageSection';
}
/**
* Handler for server's response to table requests.
* Table content is pulled from response XML and a HTML
* table is built. The table is then inserted into the
* 'tableSection' DIV.
*/
function tableResponseHandler()
{
// Make sure the request is loaded (readyState = 4)
if (req.readyState == 4)
{
// Make sure the status is "OK"
if (req.status == 200)
{
// shutdown Ajax loading progress
EndProgress();
// Make sure the XSL document is loaded
if (!xsldocloaded)
{
alert('Unable to transform data. XSL is not yet loaded.');
// break out of the function
return;
}
// transform
//document.write( xsldoc );
combine_XLM_XSLT_HTML( req, xsldoc, document, divpart );
xsldocloaded = null;
xsldoc = null;
}
else
{
alert("There was a problem retrieving the XML data:\n" +
req.statusText);
}
}
}
// ]]>
</script>
</head>
<body onload="getTablePages()">
<BIG>Simple XML servlet</BIG>
<br>
<br>Tested with IE6+, Firefox 2+ and Opera 9+. Not working with Google Chrome.
<br>Please note that tableservletdb.prg simulates a slow reply of 0.5 seconds.
If you want to check real speed please comment #define SIMULATE_SLOW_REPLY in source.
<br>Return to <a href="/">Main Page</a>
<br>
<br>Select a Page&nbsp;
<div style="border: 1px solid black; padding: 10px;" id="pageSection">&nbsp;</div>
<br />
<div style="border: 1px solid black; padding: 10px;" id="tableSection">&nbsp;</div>
</body>
</html>