測試界面
//創建輸入框 var oon = $("#message> div.room-submit-wrap> input") $("<button type='button' onclick='sc();'>POSTT!</button>").insertAfter(oon);
$("
'文本'<Textarea id = 'srk' cols = '4' rows = '1' value = '文本' > </Textarea>
").insertAfter(oon); $("
'運行速度 單位:毫秒'<Textarea id = 'speed' cols = '4' rows = '1' value = '運行速度' > </Textarea>
").insertAfter(oon);
yi = 0 function hhh3(){ //核心部分
hhh = $("#srk").val().split("。"); HHH = hhh.length; if(yi == HHH-1){ clearInterval(myshhh2); $.post("#",{message: "/me结束"}); yi = 0; } else{ $.post("#",{message: "/me"+hhh[yi]+"。"}); yi = yi+1; }
} function sc(){ //循環部分
speed2 = $("#speed").val(); myshhh2 = setInterval(hhh3,speed2);
}