本文介绍了访问本地变量(计时器ID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我试图改变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 webbrowsercontrol using MFC. However the Timer ID is stored in a local variable and Idon''t know how to access it. Is there a technique in Javascript that I mightbe 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 Iaccess 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 methodrequires 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推荐答案 所以使用一个全局变量。 你是代码的老大,不是吗? === 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) 不,我不是! 也许我不够清楚,我说在线网页换句话说,我是 下载页面及其脚本,我想禁止/更改页面 刷新计时器。 谢谢No, I''m not!Perhaps I wasn''t clear enough, I said "online webpage" in other words I''mdownloading the page and its scripts and I want to inhibit/change the pagerefresh timer.Thanks 不,我是'不是! 也许我不够清楚,我说在线网页换句话说我正在下载页面及其脚本,我想禁止/更改页面刷新计时器。 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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-31 07:44