-- 求教js如何把值传入页面里面
$(\'input:eq(2)\').click(function(){
var obj={
username:$(\'input:eq(0)\').val(),
password:$(\'input:eq(1)\').val()
};
$.ajax({
url:\'dt\',
method:\'post\',
data:JSON.stringify(obj),
success:function(res){
$(\'.cc\').html(res);
if (res== "succees") {
// layer.alert(\'登录成功\', {icon: 1});
window.location.href = \'http://127.0.0.1/demo.html\';
}
else{
window.location.href = \'http://127.0.0.1/login.html\';
layer.alert(\'登录失败\', {icon: 1});
}
},
老师如何把username值传入demo里面