【发布时间】:2013-05-31 10:49:23
【问题描述】:
我必须在单击按钮时从同一文件夹中调用其他本地 html 页面。我怎么称呼它。给定
$("#nextbutton").click(function(){
//alert('heretest')
window.location.href = 'main.html';
});
但不工作。
【问题讨论】:
-
您需要使用完整的真实 URL,而不仅仅是文件名。
-
不行还是不行
-
你试过链接吗?
-
不工作,如此描述!
-
@CodingDecoding 可能原因:1) 没有包含jQuery,2) 在
#nextbutton存在之前执行此代码,3) 多个元素与id="nextbutton",4) 文件不存在, 5) #nextbutton 不存在。
标签: javascript jquery html