我正在尝试设置我的onblur
所以它显示一个加载栏 3 秒......但是代码似乎只是错过了它并直接进入第二个函数......
function seriesIdOnBlur()
{
document.getElementById("series_id_check").innerHTML = "<img src='http://www.webscriptlab.com/file/loading/output/13759195689.gif' /> ";
setTimeout(seriesIdOnBlur2(), 3000);
}
function seriesIdOnBlur2()
{
var id = document.getElementById("series_id").value;
var message = "";
if (series[id] === undefined)
{
message = "The Series ID you input was invalid";
}
else
{
var seriesId = series[id];
var game = seriesId['game'];
var name = seriesId['name'];
message = "ID: " + id + " is for the " + name + " series playing " + game + ".";
}
document.getElementById("series_id_check").innerHTML = "<span>" + message + "</span>";
}
seriesIdOnBlur
onBlur
为带有 id 的输入调用series_id
。
我在做什么错setTimeout
?