HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //opt/remi/php56/root/usr/share/doc/pear/HTML_AJAX/examples/support/testHaa.class.php
<?php
/**
 * Require the action class
 */
require_once 'HTML/AJAX/Action.php';

class testHaa {
	function updateClassName() {
		$response = new HTML_AJAX_Action();

		$response->assignAttr('test','className','test');

		return $response;
	}

	function greenText($id) {
		$response = new HTML_AJAX_Action();
		$response->assignAttr($id,'style','color: green');
		return $response;
	}

	function highlight($id) {
		$response = new HTML_AJAX_Action();
		$response->assignAttr($id,'style','background-color: yellow');
		return $response;
	}

	function duplicate($id,$dest) {
		// there really should be an action method to do this
		$response = new HTML_AJAX_Action();
		$response->insertScript("
			var newNode = document.getElementById('$id').cloneNode(true);
			newNode.id = 'newNode';
			document.getElementById('$dest').appendChild(newNode);");
		return $response;
	}
}