ajax
JS代码如下:(页面请求)
$.ajax({ type:'get', url:'<?php echo URL::base(true)?>purchasepay/finance/purchasepay/payaction', async:false, data:{'id':id,'pay':payvalue,'needpay':needpayvalue}, dataType:'json', success:function(data) { nep=needpayvalue-payvalue; hasp=payvalue+haspayvalue; needpay.text(nep); pay.val("0"); haspay.text(hasp); if(0>=nep){ pay.attr("disabled","disabled"); } }, error:function(){ alert("error"); } });
PHP回馈如下:(服务器响应)
$s=$_GET['id'].$_GET['needpay'].$_GET['pay']; if (isset($_GET)) { $this->Payaction($_GET['id'], $_GET['needpay'], $_GET['pay']); } echo json_encode($s);exit();
其他参数: