1、今天挺纳闷的,用以往熟悉的$.post方法传值,竟然得到的
g.port值是undefined。
可是输出g的内容是:{"0":"1","id":"1","1":"2014-08-28 16:15:47","last_login_time":"2014-08-28 16:15:47","2":"admin","account":"admin","3":"admin","password":"admin","4":"\u8d85\u7ea7\u7ba1\u7406\u5458","name":"\u8d85\u7ea7\u7ba1\u7406\u5458","5":"","email":"","6":"1","sex":"1","7":"","mobile":"","8":"","mac":"","9":"4","group_id":"4","10":"0","domain_id":"0","11":"smsadmin","winusername":"smsadmin","12":"","windomain":"","13":"sms123456","winpassword":"sms123456","14":"0","cpu_count":"0","15":"0.00","memory_size":"0.00","16":"0.00","space_size":"0.00","17":"75","default_vmware_id":"75","18":"0","role_id":"0","19":"2014-03-04 11:08:08","add_time":"2014-03-14 11:08:08","20":null,"no":null,"group_name":"\u5546\u5b66\u9662","role_name":"admin","port":"3389"}
代码如下:
function desk(o)
{
var eid = $(o).parents('tr').attr('eid');
loadding();
$.post(action.infourl,{
id:eid
},function(d){
msg(d);
$.post('./ajax/user/login_info',{
},function(g){
alert("g:"+g);
alert('hyrdp://'+encodeURIComponent('label='+d.name+'&host='+d.client_ip+'&port='+g.port+'&username='+g.winusername+'&password='+g.winpassword+'&domain='+g.windomain));
window.location.href = 'hyrdp://'+encodeURIComponent('label='+g.name+'&host='+g.client_ip+'&port='+g.port+'&username='+g.winusername+'&password='+g.winpassword+'&domain='+g.windomain);
event.stopPropagation();
});
},'json');
}
2、我一直不相信是我错了,结果问了一下飞哥,才发现真的是我错了,我在第二个$.post中掉了一个'json'
g.port值是undefined。
可是输出g的内容是:{"0":"1","id":"1","1":"2014-08-28 16:15:47","last_login_time":"2014-08-28 16:15:47","2":"admin","account":"admin","3":"admin","password":"admin","4":"\u8d85\u7ea7\u7ba1\u7406\u5458","name":"\u8d85\u7ea7\u7ba1\u7406\u5458","5":"","email":"","6":"1","sex":"1","7":"","mobile":"","8":"","mac":"","9":"4","group_id":"4","10":"0","domain_id":"0","11":"smsadmin","winusername":"smsadmin","12":"","windomain":"","13":"sms123456","winpassword":"sms123456","14":"0","cpu_count":"0","15":"0.00","memory_size":"0.00","16":"0.00","space_size":"0.00","17":"75","default_vmware_id":"75","18":"0","role_id":"0","19":"2014-03-04 11:08:08","add_time":"2014-03-14 11:08:08","20":null,"no":null,"group_name":"\u5546\u5b66\u9662","role_name":"admin","port":"3389"}
代码如下:
function desk(o)
{
var eid = $(o).parents('tr').attr('eid');
loadding();
$.post(action.infourl,{
id:eid
},function(d){
msg(d);
$.post('./ajax/user/login_info',{
},function(g){
alert("g:"+g);
alert('hyrdp://'+encodeURIComponent('label='+d.name+'&host='+d.client_ip+'&port='+g.port+'&username='+g.winusername+'&password='+g.winpassword+'&domain='+g.windomain));
window.location.href = 'hyrdp://'+encodeURIComponent('label='+g.name+'&host='+g.client_ip+'&port='+g.port+'&username='+g.winusername+'&password='+g.winpassword+'&domain='+g.windomain);
event.stopPropagation();
});
},'json');
}
2、我一直不相信是我错了,结果问了一下飞哥,才发现真的是我错了,我在第二个$.post中掉了一个'json'