Q:
Hello, script expert! How do I pause scripts in HTA?
-- TJ
A:
Hello, TJ. You know, since ancient times, people have spent a lot of time and energy exploring the meaning of life. Script experts have never been involved. Why? Well, let alone lazy. We know that doesn't matter: Even if you find the meaning of life, no one cares about it. No one wants to know why we exist. On the contrary, they-just like you-just want to know how to pause an embedded HTML application. Program(HTA. That is what script experts devote themselves.
Now, if you are not familiar with HTA, you may first think of "using wscript. Sleep ". (By the way, if you are not familiar with HTA, you can browse the HTA developers center ).) This is a good idea, but it cannot be implemented. Why? Because the wscript object is a slightly unique object, one of the reasons is that you cannot actually create an instance of this object. As long as you run under the Windows Script Host, wscript will automatically provide you. This is where the problem occurs: When you run CodeYou are not running under Windows Script Host. You are actually running under the Script Host provided by Internet Explorer. Because you are not running under Windows Script Host, you cannot automatically access wscript objects. Because you cannot create your own wscript objects, you cannot access wscript. Sleep. In high-tech terms, it is "paralyzed.
If Internet Explorer provides methods similar to wscript. Sleep, this is not a big deal; unfortunately, it does not. Is there a magical solution that we can use to replace sleep? Is this necessary? <Input id = "runbutton" type = "button" value = "run button" onclick = "test">
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.