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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:53:18+00:00 2026-05-21T06:53:18+00:00

I use Sencha Touch and Phonegap to build a small app. In this app

  • 0

I use Sencha Touch and Phonegap to build a small app.
In this app I need the google maps API as I want to display a map.

There is a problem if the device has no internet connection, so the google maps API couldn’t be loaded in the html. So I check for the internet connection.
If the internet connection is available I try to load the google maps API with Ext.data.connection:

var conn = new Ext.data.Connection();
var url = 'http://maps.google.com/maps/api/js?sensor=true&'; 
conn.request({  
     url: url,
     callback: function(options, success, response){
           if(response && response.responseText){
                // do something
           }
     },
     method:'GET'}
);

If I test the app in google chrome I receive following error: XMLHttpRequest cannot load http://maps.google.com/maps/api/js?sensor=true&_dc=1302077479281. Origin null is not allowed by Access-Control-Allow-Origin.

It doesn’t matter if I try to invoke the HTML via file:/// or via a webserver (http://localhost/app)

How can I get the google maps API and “bypass” or avoid this Access-Control-behaviour?

  • 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-21T06:53:19+00:00Added an answer on May 21, 2026 at 6:53 am

    Hering, sorry, this won’t be an easy answer.

    I think you want to use a conditional script loader. These are api’s that will add the script to the document only if a condition (you have a network connection) is met.

    A good one is http://yepnopejs.com/

    According to this thread, it is possible to load google maps, but you must do as it says in the thread. Google Maps with YepNope

    Specifically, include yepnope.js and remove any references to google maps.

    yepnope([{
            load: 'http://www.google.com/jsapi',
            callback: function(){
                google.load("maps", "3", {
                    callback: function(){
                        console.log("loaded");
                    },
                    other_params: "sensor=false"
                });
            }
        }]);
    

    When it is time to render the map (which must be done after Google Maps is fully loaded) make sure you add the Ext.Map card, then call:

    this.doLayout();
    

    I think this’ll work great for you, it’s working for me…

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

Sidebar

Related Questions

in my sencha touch app I need to display a list of over 600
I am new in phonegap development environment and i want to use Sencha touch
I am using Sencha Touch with Phonegap to bring my app to iOS. When
With Sencha Touch, i want to use some of the icons in the directory
I have an app that has several different pages that use Sencha Touch. Ocassionally
I'm trying to learn how to use Sencha Touch to build web apps. I've
I want to get the list component in sencha touch to use the regular
I want to use a jQuery plugin in my Sencha Touch application. The jQuery
I'm using PhoneGap and Sencha Touch to display a form. I'm using an image
I'm working on a mobile web-app using sencha touch, HTML5 and phonegap as a

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.