//post 方法一:
$.post(
'http://127.0.0.1/bs/AjaxDemo_part1.nsf/post_json?openagent',
{
name:'hello word',
count :'一万元',
message : '韦洪声'
},
function(response) {
$("#aaa").val(response);
}
);
//post 方法二
function ajax_post(dbpath,key,msg){
var url=window.location.href;
var b=url.substring(0,url.indexOf(".nsf")+4);
console.log(b);
$.ajax({
url: b+"/ajax_flow?openagent&id="+Math.random()
, type:'POST'
, data: {"dbpath":escape(dbpath)
,"key":escape(key)
,"msg":escape(msg)
}
, dataType:"json"
, error:function(errTXT){
alert(errTXT);
}
, success:function(json){
console.log(json[0].msg)
}
});
}