如何在javascript

时间:2017-04-07 10:50:10

标签: javascript

如何在5或6秒后显示功能

    function a() {
alert("after 5 seconds");
}

a();

2 个答案:

答案 0 :(得分:0)

您可以使用所需的所有JS计时器。

setTimeout / setInterval等。

var duration = 5000; #in ms, miliseconds. 5000 = 5s

function delayedAlert() {
  window.setTimeout(slowAlert, 5000);
}

function slowAlert() {
  alert('That was really slow!');
}

https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers

中查看更多内容

答案 1 :(得分:0)

site_project2:
    enable: true
    pool:
      version: php7.4

    server_name: project2.de.dev.local

    vhost_ssl:
      document_root: /home/www/project2/www/