【发布时间】:2012-05-11 04:24:34
【问题描述】:
<html>
<head>
<meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no"/>
<script type="text/javascript">
function helloWorld() {
alert("Hello World");
}
</script>
</head>
<body onload="helloWorld();">
<h1>Hello World</h1>
</body>
</html>
我有一个使用类似于上面的 Blackberry WebWorks 构建的应用程序。每次用户打开应用程序时,我都需要触发上述 helloWorld() 函数。
问题是“onload”功能仅在应用首次启动时触发,或者当用户通过点击“手机上的挂断按钮”退出应用时触发,而不是在点击“手机上的后退按钮”时触发。
有什么建议吗?
【问题讨论】:
标签: javascript jquery html blackberry blackberry-webworks