【发布时间】:2013-01-19 04:45:06
【问题描述】:
如何使 window.location 转到同一页面但使用另一个不同的 div 标签(或通过 div id 像这样:href="#id")。
if((mins == 0) && (secs == 0)) {
window.alert("Time is up.Your score is "+score); // change timeout message as required
window.location = "index.html" // redirects to specified page once timer ends and ok button is pressed
} else {
cd = setTimeout("redo()",1000);
}
任何帮助将不胜感激。 提前致谢。
【问题讨论】:
-
您正在寻找
location.hash。 -
window.location = "/absolute/path/to/page#your-div-id";
标签: javascript html jquery-mobile