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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:15:13+00:00 2026-05-23T14:15:13+00:00

I just started looking at Backbone.js. Now i wan’t to create a simple search

  • 0

I just started looking at Backbone.js. Now i wan’t to create a simple search similar to google where the url updates “on the go”. So if you submit a form i want the url to update to http://www.site.com/#/search/I-searched-for-something.

I appreciate every answer 🙂

  • 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-23T14:15:14+00:00Added an answer on May 23, 2026 at 2:15 pm

    If I understand the question, you want an arbitrary URL that includes your search term as part of the URL. And I suspect that your problem is you don’t see how to do that with the routes architecture.

    Routes are nothing but regular expressions:

    var MyController = Backbone.Controller.extend({
        routes: {
            RegExp('^search/(.*)$'): "handle_search"
        },
    
        handle_search: function(search_term) {
            search_term = decodeURIComponent(search_term);
            /* Do something ajaxy with the search term in the search model,
               which in turn triggers the search view to refresh... */
        }
    });
    

    After that, you would apply a click handler to the button on the search form (or maybe a keypress==13 manager to the search field itself) that, instead of actually doing anything, just sets window.location.hash = escapeURIComponent($('#search_field').val())

    It’s roundabout, but it gets the job done. Your URLs will be ugly with all the %XX’s in them, but they’ll all be bookmarkable, which is the only reason to do something like this.

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

Sidebar

Related Questions

I have just started looking at javascript so hopefully this will be something simple.
I just got started looking at using Solr as my search web service. I
I have just started looking into jquerymobile, done simple samples using jquery.mobile-1.0a1 . I
How would you test this scenario? I've just started looking into NHibernate and having
Just some days ago I started looking into a unit test framework called check,
I've just started at a new communications company, and we're looking at a workflow
I have been looking at using TDD and implementing proper testing (only just started
I'm looking for a fuzzy date algorithm. I just started writing one and realised
HI all, I'm just getting started with developing for Android. I'm looking to port
Just started looking into encryption using keys and certificates in sql server 2005/08 and

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.