Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7520913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:08:55+00:00 2026-05-30T02:08:55+00:00

I’m using the datatables JQuery plugin. I use it with AJAX and pagination (server-side).

  • 0

I’m using the datatables JQuery plugin. I use it with AJAX and pagination (server-side). Each row contains a link to a detailed view of that record. When clicking in that link and then on the back button I want to return to the previous page. (Note: datatables own state-saving can’t be used).

This could be achieved If you could add a url parameter to the current url before it is put into the history.

Can this be done? pure JS or JQuery does not really matter.

(Note: I’m quite new do this kind of stuff, have read about using the # for this but never done it so if you recommend that please provide an example applicable to my problem)

EDIT:

Very basic Guide for JQuery plugin bbq
(http://benalman.com/projects/jquery-bbq-plugin/)

Assuming URL has a hash of #a=2&b=test, you can get the values by:

//true = optional converts 2 to an integer, false to boolean,...
var a = $.bbq.getState('a',true);

You can change/add a value by:

var hash = "a=3&b=hello";
$.bbq.pushState(hash);

pushState fires hashchange Event in case it is bound. To bind the event but following in doucment.ready function:

// called when # part of URL is modified
$(window).bind( 'hashchange', function( event ) {
    var hash = event.fragment; // full hash as string
    var a = event.getState('a', true ); // value for a
    // here do meaningful action like an AJAX request using the hash parameters    
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:08:57+00:00Added an answer on May 30, 2026 at 2:08 am

    Yes, the HTML5 History API allows you to do just that. Check out the Manipulating the Browser History article at MDN.

    Here is an example that adds a parameter to the current URL and replaces the current history entry:

     var newURL = location.href + (location.search ? "&" : "?") + "myParameter=myValue";
     history.replaceState({}, '', newURL);
    

    The History API is an HTML5 feature and unfortunately not supported on all browsers. However, there is a polyfill named history.js, which claims to bring support to all browsers.

    UPDATE:

    Instead of rolling your own AJAX history implementation you would probably want to look at existing solutions and jQuery plugins. Have a look e.g. at the answers to the What is the best back button jQuery plugin? question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am reading a book about Javascript and jQuery and using one of the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.