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

  • SEARCH
  • Home
  • 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 8408689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:42:08+00:00 2026-06-09T23:42:08+00:00

I am using jquery ajax calls to change content in a div by clicking

  • 0

I am using jquery ajax calls to change content in a div by clicking links, but my url always the same i mean its not changing by clicking the links just content changes.

so i find history.pushStates which helped me to change the url by clicking link, but it does not create history states, i mean back button of my browser is not calling past ajaxcalls.

This is my javascript code.

function PostFunc(id,page,name)
{
$.ajax
({
type: "POST",
url: "doAjax.php",
data: "mode=viewtopic&threadid="+id+"&page="+page,
success: function(msg)
    {
    $("#entrylist").ajaxComplete(function(event, request, settings)
        {
        $("#entrylist").hide().html(msg).fadeIn();
        counter = 0;
        /* TODO : LEARN PUSHSTATES */
        var replaced = name.replace(/ /g,"+");
        history.pushState(null, null,"viewtopic.php?title="+replaced);
        });
    }
});

ye.. my problem is shortly i dont know how to handle pushstates in my jquery code, and all other codes are seem so strange like they are not for ajaxcalls :/

  • 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-06-09T23:42:10+00:00Added an answer on June 9, 2026 at 11:42 pm

    You need to keep track of hashchange events and push your states to the window hash part of the URL. Here is a good discussion on keeping history on dynamic pages.

    You could also find this post helpful. I have personally used hashchange plugin (detailed here) for dynamic pages, ant it works just fine for maintaining the history in synch and supporting back/forward buttons for dynamic content.

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

Sidebar

Related Questions

I have a website that uses ajax jquery and colorbox. Inside the div #content
I'm using jQuery's AJAX function, like so: $.ajax ({ url : /note, async :
Possible duplicate: jquery change div text The above question is a possible duplicate, but
I am trying to invoke webservice using jquery ajax call. I am using jasonp
I'm using a jQuery ajax call to get several entries from a large set
I am loading feed-items into a ul using this jQuery .ajax() call, which I
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I am using jQuery to make an AJAX call to a ruby method in
I'm using JQuery to make an Ajax call. I used a sniffer to catch
I am making an AJAX call using jQuery to an .ascx control's method in

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.