TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ravi sharma
NA
87
16.6k
Browser back not working after search pagination change
Aug 8 2019 2:56 AM
Hi,
I am on home page and from there I am searching "Technical Support" in my global search. Now it's redirecting to search page. There we have following URL and On change of pagination and radio button, url hash and pagination is change only without reloading whole url.
1: Initial URL:
http://dev.abc.com
2: After global search:
http://dev.abc.com/search?query=Technical%20Support&index=0&size=25#all
3: Pagination Change:
http://dev.abc.com/search?query=Technical%20Support&index=1&size=25#all
4: Radio button change
http://dev.abc.com/search?query=Technical%20Support&index=0&size=25#products
Now, on pagination change or radio button click, we have following code in jquery.
key: "updateBrowserHistory",
value: function updateBrowserHistory(obj, browserURL) {
if (Object.keys(obj.params).length > 0) {
browserURL = browserURL.replace(/\?*$/, '?');
for (var i = 0; i < Object.keys(obj.params).length; i++) {
var key = Object.keys(obj.params)[i];
var value = obj.params[key];
browserURL += key + '=' + value;
if (i + 1 < Object.keys(obj.params).length) {
browserURL += '&';
}
}
} else {
browserURL = browserURL.replace(/\?*$/, '');
}
if (obj.hash) {
browserURL += "#" + obj.hash;
}
window.history.pushState({ 'html': '' }, '', browserURL);
}
Now when I click on back or forword from browser, it's working fine for all ajax call where url is getting refresh only. But it's not going on step 1 from where we entered search text.
Please suggest.
Reply
Answers (
0
)
Download the PDF
range slider for character(word) jquery