我對分頁概念有一個休息服務調用。現在在點擊下一個按鈕/圖標的分頁概念中,我可以調用其餘服務,它返回所需的值,但URL沒有更改,我需要更改URL中的頁碼。我的代碼是下一個圖標事件是如下,」更改Ajax調用中的URL問題
function nextPage(currentPage, totalPageCount) {
alert(currentPage+ " Begin nextPage Method " + totalPageCount);
var nextPage = currentPage+1;
var ctx = "${context}";
var url = ctx+"/adtrack/storelist/National/1/"+nextPage;
console.log(url);
if(nextPage <= totalPageCount)
{
jQuery.ajax({
url: url,
type: "GET",
success: function(msg) {
alert("Success");
},
error : function(msg) {
alert("Fail");
}
});
}
else{
alert("Unable to perform the action!!!");
}
// return true or false, depending on whether you want to allow the `href` property to follow through or not
}
在上面把它傳到了URL和返回值,但我還需要改變當前的URL網址最新。我如何更新網址?
什麼都我打那個URL的URL必須更新的瀏覽器當前的URL
嘗試使用window.location.href = 「_to _your_ URL」; –