我有疑问,如何在 Jquery 终端中添加价值?像这样的东西:
jQuery(function($, undefined) {
$('#terminal').terminal(function(command) {
if(command == 'test ' + value) { // Value (something a user wrote)
alert(value);
}else{
alert("You don't wrote anything.");
}
}, {
greetings: 'Hello.',
name: 'Name',
prompt: 'Terminal> ',
color: 'some color'
});
});
我的意思是这样的:
if(command == 'you type ' + userText) {
alert(userText);
} else {
alert("You don't wrote anything.");
}