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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:36:41+00:00 2026-06-11T19:36:41+00:00

I am currently working on a mobile application based on the modular approach from

  • 0

I am currently working on a mobile application based on the modular approach from :

http://weblog.bocoup.com/organizing-your-backbone-js-application-with-modules/

I am having some issues on the routing and i can’t get my hand on what can be causing the problem.

My router definition is as follows :

    var AppRouter = Backbone.Router.extend({
    routes: {            
        'module1' : 'module1_home', // working        
        'module1view/:id' : 'module1_view',    //Not working                  
        // Default
        '*actions': 'defaultAction' //Working
    },
    initialize:function () {
        // Handle back button throughout the application
        $('.back').live('click', function(event) {
            window.history.back();
            return false;
        });
        this.firstPage = true;
    },
    module1_view : function(id)
    {        
        var module1 = MyApp.module('module1');
        var view = new module1.DisplayView;        
        this.changePage(view);            
    },    
    defaultAction : function () {
        var home = MyApp.module('home');
        var view = new home.DefaultView;  
        this.changePage(view);
    },
    changePage:function (page) {        
        $(page.el).attr('data-role', 'page');
        page.render();
        $('body').append($(page.el));
        var transition = 'slide';

        if (this.firstPage) {
            transition = 'none';
            this.firstPage = false;
        }
        $.mobile.changePage($(page.el), {
            changeHash:true, 
            transition: transition
        });
    }
});

Here are example URL and the results

http://localhost:12345/myapp/ => shows the default view
http://localhost:12345/myapp/index.html => shows the default view
http://localhost:12345/myapp/#module1 => shows module1 home view
http://localhost:12345/myapp/index.html#module1 => shows module1 home view

http://localhost:12345/myapp/#module1view/123 => url changes to http://localhost:12345/myapp/module1view/123 and displays the default view
http://localhost:12345/myapp/index.html#module1/123 => url changes to http://localhost:12345/myapp/module1view/123 and displays the default view

I have also deactivated JQM navigation using

jQuery(function($) {    
    $(document).on("mobileinit", function () {
        $.mobile.ajaxEnabled = false;
        $.mobile.linkBindingEnabled = false;
        $.mobile.hashListeningEnabled = false;
        $.mobile.pushStateEnabled = false;

        // Remove page from DOM when it's being replaced
        $('div[data-role="page"]').live('pagehide', function (event, ui) {
            $(event.currentTarget).remove();
        });
    });          
});

I also using WAMP as web server here and firefox as test browser.

Did someone have similar issues and can give me some insights on how to solve this problem ?

Update#1:
Some complementary information, the alert is not called here :

module1_view : function(id)
    { 

        alert(id);
    }

Thus I may think that something is going on upper in the code.

  • 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-11T19:36:43+00:00Added an answer on June 11, 2026 at 7:36 pm

    I was able to find the problem. It seems that putting the JQM settings inside :

    jQuery(function($) {    });
    or
    $(function() { });
    

    did not trigger the doc $(document).on(“mobileinit”, function () { }); for some reason. I still need to investigate on this one.

    But removing triggers the command and JQM navigation is disable and i can use backbone router properly.

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

Sidebar

Related Questions

Currently i working on an Android based mobile application. It will be integrated to
Currently I am working on a mobile based application using Flex 4 and action
I am currently working on a mobile application with VS2008 which has a capacbility
So here's my problem. I'm currently working on a PhoneGap application using jQuery Mobile
I am designing a Netflix Application for BlackBerry mobile devices. I am currently working
I'm currently working on a consumer mobile application project and have read that 40%
I am currently working on the creation of an application for mobile devices with
I am busy working on a mobile application that retrieves data from a web
I am currently working on a application .when i installed my_app in android mobile
the application i'm currently working on is mobile network dependant, so my question is,

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.