我有问题,我希望用户注册然后登录,但这是错误的任何人都可以帮助我吗?我看到了文档。这是文档jquery termi[jquery terminal] 1 nal的链接
这是我的脚本:
if (command == 'register') {
term.push(function(command, term) {
term.pause();
$.ajax({
url: "register.php",
type: "post",
data: {data_register : command },
success: function (msg) {
term.echo(yellow('Data Saved Successfully !'));
term.resume();
},
error: function(jqXHR, textStatus, errorThrown) {
term.resume();
}
});
},
{
prompt: " > "
});
} else if (command == 'login'){
login: function(user, password, callback) {
if (user == 'demo' && password == 'secret') {
callback('SECRET TOKEN');
} else {
callback(null);
}
}
}
这一行的错误:
else if (command == 'login'){
login: function(user, password, callback) {
if (user == 'demo' && password == 'secret') {
callback('SECRET TOKEN');
} else {
callback(null);
}
}
}
谢谢