This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kurs:ajax-add2 [2009/12/02 11:01] mh |
kurs:ajax-add2 [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <?php | ||
+ | require ('xajax/xajax_core/xajax.inc.php'); | ||
+ | $xajax = new xajax(); | ||
+ | |||
+ | $xajax->configure('javascript URI', '/'); | ||
+ | |||
+ | function add2($number) { | ||
+ | |||
+ | $objResponse = new xajaxResponse(); | ||
+ | $objResponse->assign('domain_label', 'innerHTML', $number + 2); | ||
+ | return $objResponse; | ||
+ | |||
+ | } | ||
+ | |||
+ | $req_get_domain =& $xajax->registerFunction('add2'); | ||
+ | $req_get_domain->setParameter(0, XAJAX_INPUT_VALUE, 'domainname'); | ||
+ | $xajax->processRequest(); | ||
+ | |||
+ | ?> | ||
+ | <html> | ||
+ | <head> | ||
+ | <title>finger</title> | ||
+ | <?php | ||
+ | $xajax->printJavascript(); | ||
+ | ?> | ||
+ | </head> | ||
+ | <body> | ||
+ | | ||
+ | Domain: <input name="domainname" id="domainname" type="text" size="30" maxlength="60" | ||
+ | onkeyup='<?php $req_get_domain->printScript(); ?>;'> | ||
+ | <div id="domain_label"></div><br /> | ||
+ | |||
+ | </body> | ||
+ | </html> | ||