当网络浏览器开始在线工作时,ononline 属性就会触发。您可以尝试运行以下代码来实现ononline 属性 -
<!DOCTYPE html> <html> <body ononline = "onlineFunc()" onoffline = "offlineFunc()"> <script> function onlineFunc() { alert ("Working online!"); } function offlineFunc() { alert ("Workinf offline!"); } </script> <p>Got o the web browser menu bar and click the File menu. Select "Work Offline" and toggle between online and offline.</p> </body> </html>
以上是当浏览器开始在线工作时,在HTML中执行一个脚本吗?的详细内容。更多信息请关注PHP中文网其他相关文章!