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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:11:10+00:00 2026-06-02T07:11:10+00:00

I have a jquery mobile app that i am wrapping in Phonegap for Iphone/Android

  • 0

I have a jquery mobile app that i am wrapping in Phonegap for Iphone/Android store.
I have one page that uses an iframe, which without Phonegap, works just like you would expect.
However, once wrapped, the Iframe actually causes the app to open a new window/browser, and leave the app.
Does anyone know if there is a solution for this ?
THanks!

  • 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-02T07:11:11+00:00Added an answer on June 2, 2026 at 7:11 am

    http://denrobapps.com/2010/12/phonegap-and-iframes/

    First, open PhoneGapDelegate.m and find this code block:

    - (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {
    NSURL *url = [request URL];
    
    /*
     * Get Command and Options From URL
     * We are looking for URLS that match gap://<Class>.<command>/[<arguments>][?<dictionary>]
     * We have to strip off the leading slash for the options.
     */
     if ([[url scheme] isEqualToString:@"gap"]) {
    
        InvokedUrlCommand* iuc = [[InvokedUrlCommand newFromUrl:url] autorelease];
    
        // Tell the JS code that we've gotten this command, and we're ready for another
        [theWebView stringByEvaluatingJavaScriptFromString:@"PhoneGap.queue.ready = true;"];
    
        // Check to see if we are provided a class:method style command.
        [self execute:iuc];
    
         return NO;
    }
    
    /*
     * If a URL is being loaded that's a local file URL, just load it internally
     */
    else if ([url isFileURL])
    {
        //NSLog(@"File URL %@", [url description]);
        return YES;
    }
    
    /*
     * We don't have a PhoneGap or local file request, load it in the main Safari browser.
     */
    else
    {
        //NSLog(@"Unknown URL %@", [url description]);
        //[[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    
    return YES;
    }
    

    Insert this else-if right under the first if statement of that block:

    else if ([[url scheme] isEqualToString:@"http"])
    {
        return YES;
    }
    

    Also make sure [[UIApplication sharedApplication] openURL:url] is uncommented in the last else statement (otherwise clicking links in the iFrame will not work):

    else
    {
        //NSLog(@"Unknown URL %@", [url description]);
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've built a Jquery Mobile Android App using Phonegap which contains a form with
In a rails 3.0 app that uses jquery mobile for mobile devices I have
I have a jquery mobile app that has a page. This page has three
I have a jQuery Mobile web app which targets iOS and Android devices. A
we are creating one jQuery mobile app in that app, I have to bind
I have a jquery mobile web app. On my iPhone when I am on
I have some strange scrolling problems with my PhoneGap (using jQuery Mobile) app: I'm
I have been working with jQuery mobile 1.0.1. I have a page which drills
I have a single page jQuery Mobile app with four data-role='pages' in place; so,
I am working on a mobile app and I have an initial page that

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.