我有一些数据标签。 切换标签时如何刷新页面? 我在页面上的标签看起来像这样
<form>
<ul id="dateTab" class="nav nav-tabs">
<c:choose>
<c:when test="${activeTab eq 1}">
<li id="yd" class="active">
<a data-toggle="tab" href="#yesterday">Yesterday</a>
</li>
</c:when>
<c:otherwise>
<li id="yd" class="">
<a data-toggle="tab" href="#yesterday">Yesterday</a>
</li>
</c:otherwise>
</c:choose>
....
</ul>
<div id="dateTabContent" class="tab-content">
<input type="hidden" id="activeTab" name="activeTab" value="${activeTab}">
<input type="hidden" id="index" name="index" value="${index + 10}">
<c:choose>
<c:when test="${activeTab eq 1}">
<div class="tab-pane active" id="yesterday">
<tb:tableTag data="${ybooks}" id="ytable"/>
<button id="moreYbooks" class="btn btn-default" formaction="home.html">More</button>
</div>
</c:when>
<c:otherwise>
<div class="tab-pane" id="yesterday">
<tb:tableTag data="${ybooks}" id="ytable"/>
<button id="moreYbooks" class="btn btn-default" formaction="home.html">More</button>
</div>
</c:otherwise>
</c:choose>
....
</div>
</form>
JQuery函数看起来像这样
$(document).ready(
function () {
$("#dateTab a").click(function(e) {
e.preventDefault();
$(this).tab('show');
});
});
点击标签后如何刷新页面?我应该更改href
?
答案 0 :(得分:3)
这样做:
var url = window.location;
window.location = url;
答案 1 :(得分:0)
使用可以使用location.reload();