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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:15:29+00:00 2026-06-09T02:15:29+00:00

I am attempting to use jQuery Mobile’s Select Menu in a Navbar as a

  • 0

I am attempting to use jQuery Mobile’s Select Menu in a Navbar as a navigation tool. It will need to handle both internal and external links. Binding to change enables the use of the $.mobile.selectmenu() widget to fetch the selected link which has been built with custom data bits for the URL and locality status. The link is then dynamically appended to the document and .trigger('click') is called.

http://jsfiddle.net/wZNMz/

Regardless of the permutations of binding events, return values, event propagation wrangling, and attributes the external link will not work. The internal link works just fine.

Referring to the jquery.mobile.navigation.js source triggering click should work as expected assuming the [rel='external'] is matched to enable default URL handling. Note that the plugin strips links out of <option> tags on init requiring all the hackiness of adding a link and triggering click on a <select> change.

The dirty and obvious hack is to set window.location when external and be done. This does work but I can’t see why it should be necessary to resort to that. Any thoughts or insights are appreciated!

  • 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-09T02:15:31+00:00Added an answer on June 9, 2026 at 2:15 am

    Creating a link and triggering a click on it seems a lot more hacky than using window.location, which is there for this specific reason, to forward users to a new page. For internal links you can route the request through $.mobile.changePage(). Here is an example:

    $('#mobile-nav').bind('change', function(e) {
        var nav_to = $(this).selectmenu('selected');
    
        if (nav_to.data('locality') === false) {
            //this is external, so use window.location
            window.location = nav_to.data('item-url');
        } else {
            //this is internal, so use $.mobile.changePage()
            $.mobile.changePage(nav_to.data('item-url'), {
                //here you can set options such as transition type and direction
            });
        }
    });
    

    Here is the documentation for $.mobile.changePage(): http://jquerymobile.com/demos/1.1.1/docs/api/methods.html

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

Sidebar

Related Questions

I am attempting to use a JQuery Mobile select menu without having to use
I am attempting to use a Jquery menu, that makes use of the 'easeOutBounce'
I am attempting to use the jQuery mobile events without the rest of jQuery
I'm attempting to use JQuery autocomplete and need to get the id of the
In my MVC view (using VS 2012 RC), I'm attempting to use jQuery to
I'm attempting to use the jQuery jFeed plugin for parsing an Atom, GeoRSS feed
I am attempting to use a jquery drowndown checklist control. Following some simple examples,
I am new to jQuery and attempting to use the dropdownchecklist control I am
I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6. This
I'm trying to use bassistance jquery tooltip - http://jquery.bassistance.de/tooltip/demo/ and I am attempting to

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.