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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:44:32+00:00 2026-06-08T00:44:32+00:00

I’m not sure if this can be done in javascript without any server. Basically,

  • 0

I’m not sure if this can be done in javascript without any server.

Basically, I’m using Google Maps API to generate certain search results on the same page, and I want to be able to create a share button so that when the user clicks on it, it will generate a custom link like http://www.example.com/?search=Anaheim. Then, when the user, or another user, types that url into the address bar, it will result in a page with those results.

Right now, I am only doing the search on one html page, and I’m not sure how to make it so that by entering the link, it can maybe change the default home location of my one html page? Or, is this imposible, and I should be doing something else?

Any advice will be greatly appreciated. Thanks!!

Edit: This is probably kind of confusing to understand.. But basically, I want to be able to generate links in the same way that google maps generates them when you click on the link button.

  • 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-08T00:44:34+00:00Added an answer on June 8, 2026 at 12:44 am

    jQuery BBQ (API docs) is my favorite tool to accomplish this.

    Simply add an event listener for hashchange:

    $(window).bind('hashchange', function(e) {
        var q = $.bbq.getState('q');
        if (q) {
            // do your Google Maps search for `q`
        }
    });
    

    And trigger a hashchange when the page first loads. (The event isn’t fired automatically on page load, only when the URL is changed — whether programmatically or by the user fiddling with the URL)

    $(window).trigger('hashchange');
    

    Now opening example.com/#q=Anaheim will search for Anaheim.

    For bonus points: I assume your page has a text box that calls a function when the user presses enter (and/or clicks a button). Instead of directly calling your search function, use pushState to add the search term to the URL. (Your page won’t reload.) This will make it instantly bookmarkable since the user can either add the page to their bookmarks or copy the URL from the browser’s address bar.

    // on key 13 / search button click:
    $.bbq.pushState({ q: $('#searchTerm').val() });
    

    That’s all you need. The hashchange handler picks up from there.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.