Class XOAD_HTML

Description

XOAD HTML Class.

This class is used to update the content and the style of a page.

Example:

  1. <?php
  2.  
  3. class Update
  4. {
  5. function ui()
  6. {
  7. sleep(1);
  8.  
  9. $content =& XOAD_HTML::getElementById('content');
  10.  
  11. $content->innerHTML = 'Hello World! How are you?';
  12. }
  13. }
  14.  
  15. define('XOAD_AUTOHANDLE', true);
  16.  
  17. require_once('xoad.php');
  18.  
  19. ?>
  20. <?= XOAD_Utilities::header('.') ?>
  21.  
  22. <div id="content">Hello!</div>
  23.  
  24. <script type="text/javascript">
  25.  
  26. var obj = <?= XOAD_Client::register(new Update()) ?>;
  27.  
  28. obj.ui(xoad.asyncCall);
  29.  
  30. </script>

  • version: 0.6.0.0
  • author: Stanimir Angeloff

Located in /extensions/html/classes/HTML.class.php (line 141)


	
			
Method Summary
 object The &addScriptBlock (string $script)
 object The &cssQuery (string $query)
 object The &getElementById (string $id)
 object The &getElementsByName (string $name)
 object The &getElementsByTagName (string $tagName)
 void importForm (string $id, string $formData)
 string process ()
Methods
addScriptBlock (line 310)

Adds a given JavaScript code to the output.

Note that you must use the '&' operator in order to get a reference to the script block.

You should add ';' at the end of the script.

Example:

  1. XOAD_HTML::addScriptBlock('alert("Hello World!");');

  • return: DOM element that represents the script block.
  • static:
  • access: public
object The &addScriptBlock (string $script)
  • string $script: JavaScript source code.
cssQuery (line 276)

Returns an object representing a list of elements that match a given cssQuery in the document.

Note that you must use the '&' operator in order to get a reference to the list.

Example:

  1. $messages =& XOAD_HTML::cssQuery('#message, .message-body');

  • return: DOM elements list matching the cssQuery. Note that the server has no idea whether any elements exists on the client or not.
  • static:
  • access: public
object The &cssQuery (string $query)
  • string $query: String representing the value of the cssQuery.
getElementById (line 165)

Returns the element whose ID is specified.

Note that you must use the '&' operator in order to get a reference to the element.

Example:

  1. $content =& XOAD_HTML::getElementById('content');

  • return: DOM element with the specified ID. Note that the server has no idea whether the element exists on the client or not.
  • static:
  • access: public
object The &getElementById (string $id)
  • string $id: String representing the unique id of the element being sought.
getElementsByName (line 202)

Returns an object representing a list of elements of a given name in the document.

Note that you must use the '&' operator in order to get a reference to the list.

Example:

  1. $messages =& XOAD_HTML::getElementsByName('message');

  • return: DOM elements list with the specified name. Note that the server has no idea whether any elements exists on the client or not.
  • static:
  • access: public
object The &getElementsByName (string $name)
  • string $name: String representing the value of the name attribute on the element.
getElementsByTagName (line 239)

Returns an object representing a list of elements of a given tag name in the document.

Note that you must use the '&' operator in order to get a reference to the list.

Example:

  1. $inputs =& XOAD_HTML::getElementsByTagName('input');

  • return: DOM elements list with the specified tag name. Note that the server has no idea whether any elements exists on the client or not.
  • static:
  • access: public
object The &getElementsByTagName (string $tagName)
  • string $tagName: String representing the name of the tag on the element.
importForm (line 344)

Imports an associative array to the corresponding form elements.

Example:

  1. XOAD_HTML::importForm('mainForm', array('firstName' => 'First', 'lastName' => 'Last'));

  • static:
  • access: public
void importForm (string $id, string $formData)
  • string $id: The client ID of the form.
  • string $formData: Associative array that contains the values to import.
process (line 368)

Returns the JavaScript code of all DOM elements.

You should not call this method directly.

  • return: JavaScript source code for each DOM element or null if no DOM elements were created.
  • static:
  • access: public
string process ()

Documentation generated on Sat, 12 Nov 2005 20:24:16 +0200 by phpDocumentor 1.3.0RC3