阅读背景:

使用jquery ajax技术传递json数据 php作为服务端_csid_502的博客

来源:互联网 
    function responseAdvice(msgid,userid){
        var textid="rep_text_"+msgid;
        var statusid="status_"+msgid;
        var content=document.getElementById(textid).value;
       
        if(content==""){
            alert("不能为空");
            return;
        }
        var timestamp = Date.parse(new Date());
        
        var encoded={
            "userid":userid,
            "content":content,
            "time":timestamp,
            "message_id":msgid
        }
        var jsonstr=JSON.stringify(encoded);
        $.ajax({    
            type:'post',        
            url:'__URL__/response_advice',    
            data:
                {
                    "jsondata":jsonstr
                },      
            dataType:'json',    
            success:function(json){
                document.getElementById(statusid).innerHTML=1;
            }    
        });    

    } 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: