|
action代码
class Testerp {
public static function queryCount($params, $context)
{
$x = isset($params["x"]) ? $params["x"] : "1";
$y = isset($params["y"]) ? $params["y"] : "2";
$count=$x.$y;
$ret = array();
$ret["orderCount"] = $count;
$ret["x"] = $x;
$ret["y"] = $y;
// echo json_encode($ret);
echo "ssf";
}
}
?>
js代码
Model.prototype.button1Click = function(event){
justep.Baas.sendRequest({
"url" : "/testerp/testerp",
"action" : "queryCount",
"async" : false,
"params" : {
"x":2,
"y":3
},
"success" : function(data) {
if (data !== null) {
alert(data)
// alert(data.orderCount);
//alert(data.x);
// alert(data.y);
} else {
alert("error");
}
}
});
};
回调到success函数了,但是data一定都是undefined |
|