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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:11:38+00:00 2026-05-22T02:11:38+00:00

I’m trying to create a mobile version of my views using jQuery Mobile, but

  • 0

I’m trying to create a mobile version of my views using jQuery Mobile, but it doesn’t work like expected.

I have two pages – a.html has one jQuery Mobile page (div with data-role="page") and a link to b.html which has several jQuery Mobile pages. Now if I load a.html in my browser I can go to b.html and display the main “page”, but any links inside b.html referring to other “page” divs inside b.html will fail (this are the hash links with href like #otherpage). If I go straight to b.html all links work perfectly.

Is it possible to serve several “page” divs in b.html without breaking the navigation controls?

I’m using latest jQuery Mobile 1.0 alpha 4.1.

UPDATE

Framework I’m using is Ruby on Rails.

Part of my mobile layout:

<div data-role="page">
  <div data-role="content">
    <%= yield %>
  </div>
</div>
<%= yield :pages %>

Page a.html – that is an index action of a Rails scaffold:

<ul data-role="listview">
  <% @tv_series.each do |tv_series| %>
    <li><%= link_to tv_series.title, tv_series %></li>
  <% end %>
</ul>

Page b.html – this are show actions of the same Rails scaffold:

<ul data-role="listview">
  <% @seasons.each do |season| %>
    <li>
      <!-- this are the links that work only if base page was b.html -->
      <a href="#season<%= season.id %>">Season <%= season.number %></a>
    </li>

    <%= render :partial => 'seasons/season.html.erb',
      :locals => { :season => season } %>

  <% end %>
</ul>

The season partial generates a new page div:

<% content_for :pages do %>
  <div data-role="page" id="season<%= season.id %>">
    <div data-role="content">
      whatever
    </div>
  </div>
<% end %>

Now the error I get: if I go to scaffold index (/tv_series) and select one item, I go to show page with URL /tv_series#/tv_series/:id – the links I get on this page look like /tv_series/tv_series/:id#season134 which is obviously wrong, jQuery Mobile tries an AJAX request and fails with page not found. If I go to /tv_series/:id manually all the links look fine (/tv_series/:id#season134).

  • 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-22T02:11:39+00:00Added an answer on May 22, 2026 at 2:11 am

    Finally I’ve found my answer in jQuery Mobile 1.0 alpha 4.1 documentation:

    It’s important to note if you are linking from a mobile page that was loaded via Ajax to a page that contains multiple internal pages, you need to add a rel=”external” or data-ajax=”false” to the link. This tells the framework to do a full page reload to clear out the Ajax hash in the URL. This is critical because Ajax pages use the hash (#) to track the Ajax history, while multiple internal pages use the hash to indicate internal pages so there will be conflicts in the hash between these two modes.

    So with current navigation system it’s just not possible.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I need to clean up various Word 'smart' characters in user input, including but

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.