无法从setTimeout调用警报 [英] can not get alert to call from setTimeout

查看:55
本文介绍了无法从setTimeout调用警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有理由说这个代码不会提示有人每隔5分钟保存一次他们的工作?它似乎没有工作。此代码在HTML文档的HEAD中显示




函数saveYourWorkReminder(){

alert(" It已经过了5分钟。请保存你的工作。网页浏览器是b
越野车经常崩溃。保护自己!);

}


setTimeout(" saveYourWorkReminder",300000);

Is there any reason why this code wouldn''t prompt someone to save their
work every 5 minutes? It doesn''t seem to be working. This code shows up
in the HEAD of an HTML document.

function saveYourWorkReminder() {
alert("It''s been 5 minutes. Please save your work. Web browsers are
buggy and crash often. Protect yourself!");
}

setTimeout("saveYourWorkReminder", 300000);

推荐答案

< lk ****** @ geocities.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
<lk******@geocities.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
为什么这段代码不会提示有人每隔5分钟保存一次工作?它似乎没有工作。此代码显示在HTML文档的HEAD中。

函数saveYourWorkReminder(){
警告(它已经过了5分钟。请保存您的工作。 Web浏览器经常出现问题并且经常崩溃。保护自己!);
}

setTimeout(" saveYourWorkReminder",300000);
Is there any reason why this code wouldn''t prompt someone to save their
work every 5 minutes? It doesn''t seem to be working. This code shows up
in the HEAD of an HTML document.

function saveYourWorkReminder() {
alert("It''s been 5 minutes. Please save your work. Web browsers are
buggy and crash often. Protect yourself!");
}

setTimeout("saveYourWorkReminder", 300000);




或许缺少括号?


setTimeout(" saveYourWorkReminder()",300000);

BTW,你的是什么互动的观众使用Web浏览器,需要

他们来保存他们的工作?他们将节省什么以及如何在以后检索




Perhaps missing parentheses?

setTimeout("saveYourWorkReminder()", 300000);
BTW, what does your inteneded audience do with a Web browser that require
them to save their work? What would they save and how would they retrieve
it later?


McKirahan写道:
McKirahan wrote:
< LK ****** @ geocities.com>在消息中写道
新闻:11 ********************** @ f14g2000cwb.googlegr oups.com ...
<lk******@geocities.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
是否有任何理由为什么这段代码不会促使有人每5分钟节省一笔
的工作?它似乎没有工作。此代码在HTML文档的HEAD中显示


函数saveYourWorkReminder(){
警告(它已经过了5分钟。请保存您的工作。 Web浏览器经常出现问题并且经常崩溃。保护自己!);
}

setTimeout(" saveYourWorkReminder",300000);
Is there any reason why this code wouldn''t prompt someone to save their work every 5 minutes? It doesn''t seem to be working. This code shows up in the HEAD of an HTML document.

function saveYourWorkReminder() {
alert("It''s been 5 minutes. Please save your work. Web browsers are
buggy and crash often. Protect yourself!");
}

setTimeout("saveYourWorkReminder", 300000);


也许缺少括号?
setTimeout(" saveYourWorkReminder()",300000);

Perhaps missing parentheses? setTimeout("saveYourWorkReminder()", 300000);




(剪辑)


你可以使用函数指针(没有括号的函数名),但

它是变量名,因此不带引号:


setTimeout(saveYourWorkReminder,300000) ;


警报字符串需要在一行(可能就在你所在的地方)。


为什么不弹出一个链接到一个不错的网页浏览器:o


***通过开发人员指南发送 http:// www.developersdex.com ***

不要只参加USENET ......获得奖励!



(snip)

You can use a function pointer (function name without parentheses), but
it''s a variable name and so takes no quotes:

setTimeout(saveYourWorkReminder, 300000);

The alert string needs to be on one line (probably is where you are).

Why not pop up a link to a decent web browser? :o

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


谢谢。我会这样写的:


setTimeout(" saveYourWorkReminder()",300000);


当你说' ;体面的网络浏览器你是在谈论一个允许你在一个textarea中保存你正在写的东西吗?也许是11个月之前我在网上讨论这个问题,并且在那个

时间似乎没有任何浏览器能够做到合理的工作

字处理器。有变化吗?你指的是什么?

Thank you. I''ll write it like this:

setTimeout("saveYourWorkReminder()", 300000);

When you say "decent web browser" are you speaking of one that allows
you to save the stuff you are writing in a textarea? I was in a big
online discussion about this problem perhaps 11 months ago and at that
time it seemed that there were no browsers that did a reasonable job as
word processors. Have things changed? What are you referring to?


这篇关于无法从setTimeout调用警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆