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 ></applet>

4 在JS中这样调用 document.getElementById("sleepapp").sleep(100);

相关文章:

  • 2021-12-12
  • 2021-03-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-11-24
猜你喜欢
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2018-11-10
相关资源
相似解决方案