Current File : //opt/RZphp5/includes/doc/HTML_Progress2/docs/TDG/ch10s02.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>
      Design details
    </title>
    <link rel="stylesheet" href="book.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />
    <link rel="start" href="index.html" title="HTML_Progress2 Manual" />
    <link rel="up" href="ch10.html" title=
    "Chapter&nbsp;10.&nbsp;How to to implement an AJAX Progress Bar" />
    <link rel="prev" href="ch10.html" title=
    "Chapter&nbsp;10.&nbsp;How to to implement an AJAX Progress Bar" />
    <link rel="next" href="ch10s03.html" title="Progress bar HTML design" />
    <style type="text/css">
/*<![CDATA[*/
    body {
    background-color: white;
    color: black;
    }
    :link { color: #0000FF }
    :visited { color: #840084 }
    :active { color: #0000FF }
    h2.c1 {clear: both}
    /*]]>*/
    </style>
  </head>
  <body>
    <table class="progress2Header">
      <tr>
        <td>
          <img src="img/pear_progress2.gif" align="left" alt=
          "PEAR Progress2 logo" />
          <h1>
            HTML_Progress2 : The Definitive Guide
          </h1>
          <div class="navheader">
            <table width="100%" summary="Navigation header">
              <tr>
                <th colspan="3" align="center">
                  Design details
                </th>
              </tr>
              <tr>
                <td width="20%" align="left">
                  <a accesskey="p" href="ch10.html">Prev</a>&nbsp;
                </td>
                <th width="60%" align="center">
                  Chapter&nbsp;10.&nbsp;How to to implement an AJAX Progress
                  Bar
                </th>
                <td width="20%" align="right">
                  &nbsp;<a accesskey="n" href="ch10s03.html">Next</a>
                </td>
              </tr>
            </table>
          </div>
        </td>
      </tr>
    </table>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <h2 class="title c1">
          <a name="ajax.design" id="ajax.design"></a>Design details
        </h2>
      </div>
      <p>
        Tracking the progress of a server-side operation by a client requires
        only one operation. A polling loop that will iterate one or more times
        until server task is completed (100%). This is done by JS function
        <span class="bold"><strong>HTML_Progress2.statusCheck</strong></span>
        what will send periodically (update by interval; default is 2 seconds)
        a request to server either with :
      </p>
      <div class="itemizedlist">
        <ul type="disc">
          <li>class/method :
            <p>
              <span class=
              "bold"><strong>HTML_Progress2.serverClassName</strong></span>,
              <span class=
              "bold"><strong>HTML_Progress2.serverMethodName</strong></span>
            </p>
          </li>
          <li>or simple php function :
            <p>
              <span class=
              "bold"><strong>HTML_Progress2.serverCallback</strong></span>,
            </p>
          </li>
        </ul>
      </div>
      <p>
        as callback.
      </p>
      <p>
        When the user-task is over and server return progress bar reach 100%
        (key: percentage, value: 100), client run function identified by
        <span class="bold"><strong>HTML_Progress2.onComplete</strong></span>
        (default behavior is to reload the same page with query string
        "reload=true").
      </p>
      <p>
        If you want to change this behavior, you have just to change value of
        public <span class=
        "bold"><strong>HTML_Progress2.onComplete</strong></span> variable, and
        identify another function. See scriptaculous1 and scriptaculous2
        examples.
      </p>
      <p>
        Launching polling loop through asynchronous communication, is done by
        only one client action: run JS function <span class=
        "bold"><strong>HTML_Progress2.start</strong></span> with identifier of
        progress bar (given by HTML_Progress2::getIdent), and with an optional
        latency (in millisecond) between two request calls.
      </p>
    </div>
    <table class="progress2Footer">
      <tr>
        <td align="left">
          HTML_Progress2 : The Definitive Guide
        </td>
        <td align="right">
          v 2.4.0 : April 20, 2007
        </td>
      </tr>
    </table>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left">
            <a accesskey="p" href="ch10.html">Prev</a>&nbsp;
          </td>
          <td width="20%" align="center">
            <a accesskey="u" href="ch10.html">Up</a>
          </td>
          <td width="40%" align="right">
            &nbsp;<a accesskey="n" href="ch10s03.html">Next</a>
          </td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">
            Chapter&nbsp;10.&nbsp;How to to implement an AJAX Progress
            Bar&nbsp;
          </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top">
            &nbsp;Progress bar HTML design
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>