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");
            }
        });
js

PHP回馈如下:(服务器响应)

        $s=$_GET['id'].$_GET['needpay'].$_GET['pay'];
        if (isset($_GET)) {
            $this->Payaction($_GET['id'], $_GET['needpay'], 
                    $_GET['pay']);
        }
        echo json_encode($s);exit();
PHP

 

其他参数:

  

posted @ 2014-05-10 14:16  UCanBeFree  阅读(119)  评论(0编辑  收藏  举报