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 6880221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:56:48+00:00 2026-05-27T04:56:48+00:00

While retrieving items via AJAX etc., the links are set to do this: $(this).click(function(){

  • 0

While retrieving items via AJAX etc., the links are set to do this:

$(this).click(function(){
ajax_function(); // hypothetical ajax call that puts data into a <div> of my choice
return false;
});

In this scenario, I’m wondering what the best way is to utilize jQuery to add things to my URL in this format:

http://www.mydomain.com/products

turns into

http://www.mydamain.com/products#category-12,page-4

Further note- I’m talking about the actual URL of the browser (in the URL bar) not a URL that is part of the DOM.

  • 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-27T04:56:49+00:00Added an answer on May 27, 2026 at 4:56 am

    After searching some more (with better keywords than before on Google) I found the answers I needed, and I wrote the following functions:

        function get_url_hash(argument) {
        var hash = location.hash.replace('#','');
        if(argument=='' || argument==undefined) {
            return hash;
            alert(blank);
        } else {
            var foundhash = false;
            // specific argument given - let's find the value attached. 
            var hashblock = hash.split(',');
            for(x in hashblock) {
                var hasharray = hashblock[x].split('-');
                if(hasharray[0]==argument) {
                    return hasharray[1];
                    foundhash = true;
                }
            }
            if(foundhash==false) {
                return false;
            }
        }
    }
    
    function modify_url_hash(argument, value) {
        // This function goes through the entire hash,
        // figures out which parts of the hash should be added, updated or removed based on entry, 
        // and then spits out final result. 
        var hash = get_url_hash();
        var foundhash = false; // foundhash is set to false by default. if this hash is NOT found, then we add it at the end! 
        var hashcount = 0; // keep count of total # so as to determine where to put the commas etc. 
        var newhash = '';
        if(hash.length>0) {
            var hashblock = hash.split(',');
            for(x in hashblock) {
                var hasharray = hashblock[x].split('-');
                if(hasharray[0]==argument) {
                    hasharray[1] = value;
                    foundhash = true;
                }
    
                if(hasharray[1]!=false && hasharray[1]!='') { // if new value is NOT false, we keep it in.. otherwise don't feed it to newhas so it disappears.
                    if(hashcount>0) { newhash = newhash+','; }
                    newhash = newhash+hasharray[0]+'-'+hasharray[1];
                    hashcount++;
                }
    
            }
        }
    
        if(foundhash==false) {
            // this is a new hash block. 
            if(hashcount>0) { newhash = newhash+','; }
            newhash = newhash+argument+'-'+value;
        }
        location.hash = newhash;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i posted some data using tinymce (in a symfony project).while retrieving back how can
While the C# spec does include a pre-processor and basic directives (#define, #if, etc),
I'm following the NerdDinner tutorial while building my own application. The tutorial gives this:
I am having a problem while retrieving data from an ArrayList and displaying them
i am using DateTime.UtcNow to store the date in my database .. while retrieving
I am facing some issues while retrieving data from a doctrine pager object! Let
I have a table columns:Name,Role,Dept A person can have many roles. So while retrieving
I'm using Java. This is the pure data that gets inserted in the datastore:
I have been building this app for a while now and have not had
i am having a problem while retrieving the data coming from Json... i am

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.