javascript 新页面加载时间
<input type="button" onclick=openAPage()></>
我这里有一个按钮
function openAPage() {
var myWin = window.open("http://www.sabah.com.tr","_blank")
}
和一个功能
问题:当我按下按钮时,我应该启动一个计时器,当页面完全加载时计时器将停止..
我需要什么时候按下按钮? 当页面完全加载时?
我该怎么办?
<input type="button" onclick=openAPage()></>
i have a button
function openAPage() {
var myWin = window.open("http://www.sabah.com.tr","_blank")
}
and a function
here problem: when i press the button i should start a timer and when page fully loaded timer will stop..
i need when i pressed the button?
when page fully loaded?
how should i do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你会使用 jQuery 那么我会推荐这个插件
http://keith-wood.name/countdown.html
然后在“子”窗口中,我相信这样的事情应该有效吗?
但我猜测只有当父母和孩子位于同一域时这才有效
if you can use jQuery then I would recommend this plugin
http://keith-wood.name/countdown.html
then in the 'child' window, I believe something like this should work?
but I am guessing this will work only if the parent and child are on the same domain
注意:以下 scURIple(与 javascript: scriplets 相对应的通用 URI)是无状态的,因此不受发起策略的限制。
数值结果以毫秒为单位。
适用相同站点来源和跨站点脚本策略。例如,如果
uri='http://www.google.com'
,则上面的页面必须加载到已显示来自www.google.com
的页面的窗口中>。测试使用:
Note: the following scURIple (generic URI counterpart to javascript: scriplets) is stateless and thus is unrestricted by origination policies.
The numeric results are in msec.
Same site origin and cross-site scripting policies apply. For example, if
uri='http://www.google.com'
then the page above must be loaded into a window already showing a page fromwww.google.com
.tested using: