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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:57:48+00:00 2026-06-18T12:57:48+00:00

I’m having a problem in PhoneGap 2.3.0 with JQuery Mobile 1.2.0. Any external link

  • 0

I’m having a problem in PhoneGap 2.3.0 with JQuery Mobile 1.2.0.

Any external link iniOS opens inside the app instead of opening Safari they open inside the app, making it impossible for user to get back to the app without rebooting it.

I have tried both rel=”external” and target=”_blank” to indicate it’s an external link, but none with success.

I have seen that the default way that PhoneGap with JQMobile should act is the way I want. I have found lots of requests for this kind of behaviour, but not the way around.

  • 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-18T12:57:49+00:00Added an answer on June 18, 2026 at 12:57 pm

    I added rel="external" to my anchor links.

    And then added/overrided the shouldStartLoadWithRequest method in the MainViewController class:

    - (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    {
        NSURL *url = [request URL];
    
        // Intercept the external http requests and forward to Safari.app
        // Otherwise forward to the PhoneGap WebView
        if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]){
            [[UIApplication sharedApplication] openURL:url];
            return NO;
        }
        else {
            return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
        }
    }
    

    That works for me in jQuery Mobile 1.2 and Phonegap 2.2.0. It should work the same in Phonegap 2.3.0 – but I haven’t tested that.

    ==================================================================================

    UPDATE:

    There may not be any need to do this in Phonegap 2.7.0 or above. Phonegap can now open links in either of the UIWebView, Safari or the InAppBrowser component. Personally I like the InAppBrowser component, as it seems to be a better user experience for a lot of use cases. If you want to open links in Safari you can now do this now using Javascript:

    window.open('http://whitelisted-url.com', '_system');
    

    or this for the InAppBrowser:

    window.open('http://whitelisted-url.com', '_blank');
    

    Have a look here for more information:

    http://wiki.apache.org/cordova/InAppBrowser
    http://docs.phonegap.com/en/2.7.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.