访问本地变量(计时器ID) [英] Accessing a local variable (timer ID)

查看:93
本文介绍了访问本地变量(计时器ID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我试图改变webbrowser中在线网页的刷新率
使用MFC控制
。但是,计时器ID存储在本地变量中,而我不知道如何访问它。 Javascript中是否有一种技术可以使用/ b / b
能够使用/适应吗?

我在原型中设置了一个定时器:


; HControl.prototype.setFLTimeout = function(){

var oFLTimeout = setTimeout(" hCtrl.mkView.reloadFL();",iFLTimeout);

}


但是计时器Id oFLTimeout是本地的,所以一旦页面加载,我怎么才能获得
访问并停止计时器防止页面刷新(或者可能重置

到我自己的定制费率)?

我知道如何使用clearTimeout()的唯一方法,但这种方法

需要定时器ID。


我可以列出吗?所有的计时器都不知何故?


我真的很难过,想要了解我如何进步。


谢谢

Hi,

I am trying to alter the refresh rate of an online webpage in a webbrowser
control using MFC. However the Timer ID is stored in a local variable and I
don''t know how to access it. Is there a technique in Javascript that I might
be able to use/adapt?

I have a timer set within a prototype thus:

;HControl.prototype.setFLTimeout = function() {
var oFLTimeout = setTimeout("hCtrl.mkView.reloadFL();", iFLTimeout);
}

But the timer Id oFLTimeout is local so, once the page is loaded how can I
access and stop the timer to prevent the page refreshing (or perhaps "reset"
it to my own bespoke rate)?
The only way I know how is using clearTimeout(), however this method
requires the timer ID.

Can I "list" all the timers somehow?

I really am stumped and would like some advise on how I can progress.

Thanks

推荐答案

Joe于2004年9月13日在comp.lang.javascript中写道
Joe wrote on 13 sep 2004 in comp.lang.javascript:
我正在尝试使用MFC更改
webbrowser控件中在线网页的刷新率。但是,计时器ID存储在一个局部变量中,我不知道如何访问它。 Javascript中是否有一种我可以使用/适应的技术?

我在原型中设置了一个计时器:

; HControl.prototype .setFLTimeout = function(){/> var oFLTimeout = setTimeout(" hCtrl.mkView.reloadFL();",iFLTimeout);
I am trying to alter the refresh rate of an online webpage in a
webbrowser control using MFC. However the Timer ID is stored in a
local variable and I don''t know how to access it. Is there a technique
in Javascript that I might be able to use/adapt?

I have a timer set within a prototype thus:

;HControl.prototype.setFLTimeout = function() {
var oFLTimeout = setTimeout("hCtrl.mkView.reloadFL();", iFLTimeout);




所以使用一个全局变量。


你是代码的老大,不是吗?


===
< br $>
var oFLTimeout;


HControl.prototype.setFLTimeout = function(){

oFLTimeout = setTimeout(" hCtrl.mkView。 reloadFL();",iFLTimeout);


===


-

Evertjan。

荷兰。

(请将我的电子邮件地址中的x'更改为点数,

但请让我们继续讨论新闻组)



So use a global variable.

You are the boss of the code, aren''t you?

===

var oFLTimeout;

HControl.prototype.setFLTimeout = function() {
oFLTimeout = setTimeout("hCtrl.mkView.reloadFL();", iFLTimeout);

===

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


>所以使用全局变量。
> So use a global variable.

你是代码的老大,不是吗?

You are the boss of the code, aren''t you?




不,我不是!


也许我不够清楚,我说在线网页换句话说,我是

下载页面及其脚本,我想禁止/更改页面

刷新计时器。


谢谢



No, I''m not!

Perhaps I wasn''t clear enough, I said "online webpage" in other words I''m
downloading the page and its scripts and I want to inhibit/change the page
refresh timer.

Thanks


Joe于2004年9月13日在comp.lang.javascript中写道
Joe wrote on 13 sep 2004 in comp.lang.javascript:
所以使用全局变量。

你是代码的老大,不是吗?
So use a global variable.

You are the boss of the code, aren''t you?



不,我是'不是!

也许我不够清楚,我说在线网页换句话说
我正在下载页面及其脚本,我想禁止/更改页面刷新计时器。



No, I''m not!

Perhaps I wasn''t clear enough, I said "online webpage" in other words
I''m downloading the page and its scripts and I want to inhibit/change
the page refresh timer.




的确你不是很清楚。


所以打开页面,

去查看源代码,

更改代码并保存本地文件,

然后执行此本地文件,

如有必要,在添加:

< base href =" http://原始网址在这里>在< head>中部分。

-

Evertjan。

荷兰。

(请将x''改为我的电子邮件中的点,

,但让我们继续讨论新闻组)



Indeed you were not very clear.

So open the page,
go to view source,
change the code and save the local file,
then execute this local file,
if necessary after adding:
<base href="http://the original url here"> in the <head> section.
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


这篇关于访问本地变量(计时器ID)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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