javascript中实现暂停功能
1 把以下代码保存成JsSleep.java
public class JsSleep extends java.applet.Applet
{
public void sleep(int ms)
{
try
{
Thread.sleep(ms);
}
catch(Exception e)
{
}
}
}
2 编译成JsSleep.class
3 在BODY中添加<applet id="sleepapp" code="JsSleep.class" height="5" width="147"></applet>
4 在JS中这样调用 document.getElementById("sleepapp").sleep(100);