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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:22:16+00:00 2026-05-30T18:22:16+00:00

Using this gist to prevent links from launching a browser when the site is

  • 0

Using this gist to prevent links from launching a browser when the site is saved as a home screen web app.

The script is working, to an extent. The problem is that for some reason it is calling the target page twice. This is causing Jquery Mobile to display error loading page on every page load, despite successfully loading the page.

Here is an example link:

<a href="/bookings/3/features" data-ajax="false">Link Example</a>

Here is the log from the server:

 Started GET "/bookings/3/features" for 10.104.4.210 at 2012-03-02 17:13:25 +0000
Processing by FeaturesController#index as HTML
  Parameters: {"booking_id"=>"3"}
  Booking Load (0.3ms)  SELECT `bookings`.* FROM `bookings` WHERE `bookings`.`id` = 3 LIMIT 1
  Car Load (0.2ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 2 LIMIT 1
  CarModel Load (0.2ms)  SELECT `car_models`.* FROM `car_models` WHERE `car_models`.`id` = 1 LIMIT 1
  Manufacturer Load (0.2ms)  SELECT `manufacturers`.* FROM `manufacturers` WHERE `manufacturers`.`id` = 1 LIMIT 1
  Feature Load (0.3ms)  SELECT `features`.* FROM `features` WHERE `features`.`car_model_id` = 1
   (0.2ms)  SELECT COUNT(*) FROM `car_colours` WHERE `car_colours`.`car_model_id` = 1
  Rendered features/index.html.erb within layouts/frontEnd (5.2ms)
  Rendered shared/_footer.html.erb (1.1ms)
Completed 200 OK in 62ms (Views: 56.8ms | ActiveRecord: 1.4ms)


Started GET "/bookings/3/features" for 10.104.4.210 at 2012-03-02 17:13:25 +0000
Processing by FeaturesController#index as HTML
  Parameters: {"booking_id"=>"3"}
  Booking Load (0.4ms)  SELECT `bookings`.* FROM `bookings` WHERE `bookings`.`id` = 3 LIMIT 1
  Car Load (0.2ms)  SELECT `cars`.* FROM `cars` WHERE `cars`.`id` = 2 LIMIT 1
  CarModel Load (0.2ms)  SELECT `car_models`.* FROM `car_models` WHERE `car_models`.`id` = 1 LIMIT 1
  Manufacturer Load (0.2ms)  SELECT `manufacturers`.* FROM `manufacturers` WHERE `manufacturers`.`id` = 1 LIMIT 1
  Feature Load (0.3ms)  SELECT `features`.* FROM `features` WHERE `features`.`car_model_id` = 1
   (0.2ms)  SELECT COUNT(*) FROM `car_colours` WHERE `car_colours`.`car_model_id` = 1
  Rendered features/index.html.erb within layouts/frontEnd (4.5ms)
  Rendered shared/_footer.html.erb (1.1ms)
Completed 200 OK in 26ms (Views: 20.8ms | ActiveRecord: 1.3ms)
  • 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-30T18:22:17+00:00Added an answer on May 30, 2026 at 6:22 pm

    The problem is that jQuery Mobile tries to optimize page loading and minimize requests by doing ajax instead of regular page loads. This causes the first request to be made by jQuery mobile and whilst jQuery is awaiting a return the “stay_standalone” script triggers and loads the page in a regular http page load.

    You can see the jQuery Mobile code related to this function in this two links: first in the init, and then checking for ajax flag and finally making a request. This is also in jQuery Mobile’s global config docs.

    I searched a little about jQuery Mobile in standalone mode and didn’t find anything specific. There is 2 solutions to this problem tough:

    1. Remove the gist from your site/webapp. This may be a sufficient solution, since jQuery Mobile already does the ajax for you – and the link will not open in Safari. Also this is potentially more faster, with fewer requests.
    2. If this does not work as expected, you can disable the ajaxEnabled feature in jQuery Mobile like described on their docs:

      $(document).bind(“mobileinit”, function(){
      ajaxEnabled: false
      });

    The second option is not optimal but may be a good solution until you figure how jQuery Mobile could prevent the pages loading in Mobile Safari.

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

Sidebar

Related Questions

Using this answer , I created a sample localized app. My question is, is
Im using this PHP to get a list of Title's from an RSS feed:
I am using the middleware provided in https://gist.github.com/426829 to do cross site scripting. However,
This one has me stumped. I'm using the for attribute on some links to
I've been using this gist to send an email after deployment but I'd like
I wrote this script https://gist.github.com/1313611 to ease my installs for rvm. The whole script
I think launchd is the answer, but using this plist: http://gist.github.com/553573 I get this
The following gist: https://gist.github.com/1876791 (borrowed from the demo in this question ) is a
I wrote python script for dropping tables in all Django apps. (using settings.INSTALLED_APP) https://gist.github.com/1520683
Using this question as the base is there an alogrithm or coding example 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.