- 论坛徽章:
- 0
|
.
<?php
require_once "../includes/xajax.inc.php";
function returnValue($number){
$number=($number*2);
$objResponse=new xajaxResponse();
$objResponse->addScript($number);
return $objResponse->getXML();
}
$xajax=new xajax();
$xajax->registerFunction("returnValue");
$xajax->processRequests();
?>
<html><head>
<?php $xajax->printJavascript("../includes/");?>
<script type="text/javascript">
function get(msg){
str=xajax_returnValue(msg);
alert(str);
}
</script>
</head>
<body>
<input name="num" id="num" type="text" size="5" maxlength="5" onChange="get(document.getElementById('num').value);return false;">
</body>
这样跳出来的不是数值,而是true
</html> |
|