0
控制檯在第5和第8行顯示錯誤。錯誤是「未捕獲的插入函數參數不是字符串」。任何幫助將不勝感激。謝謝!未捕獲的插入函數參數不是字符串
$(function() {
var animation = false;
function typed(term, message, delay, finish) {
animation = true;
var da = 0;
term.set_prompt('');
var interval = setInterval(function() {
term.insert(message[da++]);
if(da > message.length) {
clearInterval(interval);
setTimeout(function() {
term.set_command('')
term.set_prompt(message + ' ');
animation = false;
finish && finish();
}, delay);
}
}, delay);
}
$('#fyeah').terminal(function(cmd, term) {
var finish = false;
}, {
name: 'test',
greetings: null,
onInit: function(term) {
var msg = "testing";
typed(term, msg, 150, function() {
finish = true;
});
},
keydown: function(e) {
if (animation) {
return false;
}
}
});
});
嗯,這是不可能的,你所提供的代碼來回答。我們需要知道你傳遞的消息是什麼時候傳遞給類型化的函數。我最初的想法是,它只是沒有正確格式化爲一個字符串。 – iAmClownShoe 2013-03-21 16:11:15
你使用什麼插件? – Bergi 2013-03-21 16:12:36
@Bergi看起來像[這一個](http://terminal.jcubic.pl/) – Pointy 2013-03-21 16:13:26