var startTime = new Date().getTime();
var myWin = window.open("http://www.hizlial.com/hediyelik/hediyelik-urunler/zippo-jack-daniels-ltr-flask-hediye-seti_16.004.4126.1233.htm","_blank")
window.onload = function() { opener.window.endtime = new Date().getTime(); }
var endTime = opener.window.endtime;
var timeTaken = endTime-startTime;
document.write(timeTaken);
我編輯了新的代碼,但這次我無法寫出timeTaken值?所以這裏有什麼錯誤?網頁加載時間
window.onload行應該在目標代碼中,在這種情況下,http://www.hizlial.com/hediyelik/hediyelik-urunler/zippo-jack-daniels-ltr-flask-hediye-seti_16.004.4126。 1233.htm,那麼你也應該從打開的窗口調用完成回調。所以你打開的窗口應該有window.onload = function(){window.opener.endTime = new Date()。getTime(); window.opener.finished();}; – qwertymk 2010-12-20 03:56:16
你可以修復代碼嗎?並寫在這裏,如果你可以..我不是那麼好在JS ..我需要時間在屏幕上的價值 – 2010-12-20 04:01:07