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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:37:00+00:00 2026-06-13T13:37:00+00:00

My problem is that when I use a hash tag in a link, it

  • 0

My problem is that when I use a hash tag in a link, it just attaches the hash to the url rather than going to the route. For example /ToDo/public/offline2.html#test. If I leave the tag = "" it does go to the router for some reason.

I have turned off the jquery mobile router with following code

<script type="text/javascript">     
  $(document).bind("mobileinit", function () {  
      $.mobile.ajaxEnabled = false;         
      $.mobile.linkBindingEnabled = false;  
      $.mobile.hashListeningEnabled = false;    
      $.mobile.pushStateEnabled = false;        
      $.mobile.changePage.defaults.changeHash = false;
  });

</script>

<script src="../js/jquery.mobile.js"></script>
<script src="../js/jquery.js"></script>

How my html code is very basic

<p>go to <a href="#test"  id="#test">test page</a></p>

So I have a separate js file containing the javascript code in say file test.js. this is the main code

$(app.init)

app.init = function() {
  console.log('start init')

  router = new TestRouter();    
  console.log('end init')
}


var TestRouter = Backbone.Router.extend({           
    routes:{       
        "":"home",  
        "test":"test" 
       },   

          initialize: function(){     var self = this
              _.bindAll(self)       },  
          home: function(){         
              alert(name);  
             // $.mobile.changePage($('#home-page'), {changeHash:false});   
              },        

              test: function (name) {   
                  alert(name);          
                //  $.mobile.changePage($('#test-page'), {changeHash:false});   
                  }     
              })    

As I said the code works for the home, when I set the tag like this

<a href="" data-icon="home">Home</a>
  • 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-13T13:37:01+00:00Added an answer on June 13, 2026 at 1:37 pm

    You need to invoke Backbone.history.start() before Backbone will start monitoring for hashchange events.

    app.init = function() {
      console.log('start init')
    
      router = new TestRouter();
      Backbone.history.start();
      console.log('end init')
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Rather odd problem in that I cannot use the data variable (the information returned
In a couple of scripts that I use I have problem that is intermittent.
I'm having a problem when running programs that use Java from the command line.
I find I've been confused by the problem that when I needn't to use
My problem is that I was looking for way to use both storyboard and
I guess the problem is that I do not know how to use factory
I need to use something like get_or_create() but the problem is that I have
Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke
I have a HTML form where I use several buttons. The problem is that
I use Spring MVC [version: 2.5] and Security[version: 2.0.4]. My problem looks like that:

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.