在document.load
我调用全局函数alertabc()
,我已经定义了它,但是找不到函数的浏览器提示符。
<script>
function alertabc(){
alert('abc');
clearInterval(s);
}
var s;
$(function () {
s = setInterval("alertabc()", 100);
});
<script>
答案 0 :(得分:1)
正如 Cookie 所述,您的script
代码未关闭,
<script>
function alertabc(){
alert('abc');
clearInterval(s);
}
var s;
$(function () {
s = setInterval(alertabc, 100);
//good practice --^--as Brad said
});
</script>
//-^ do close by putting / forward slash