PHPSOFT SOLUTIONS LOGO
  • Home
  • About Us
  • Contact Us
  • Contact Us
  • Blog
  • Online Courses
  • Contact US

Phonegap access origin error resolved

Phongap storage work on :
– Local storage
– SQL Storage
– Memeory Storage

Sometime or more of the time we require to call our external servers APIs REST/SOAP .

I tried also during my first api call on phonegap ,wasted around 1 day to resolve error for this, below are the steps you need to follow:

– Laod or call any jquery function after device ready event.
– use $.getJSON(uri,function(data){});
instead $.ajax();[require jsonp and server callback] so avoid this hactic work
– on load event add
$(function(){
$.support.cors = true;
}
);

– whitelist your server address on config.xml file , say
– At server end add header in response header('Access-Control-Allow-Origin: *');

Its done, any missing step will result in server or call error!

Posted on February 2014
Category: phonegap

Categories

  • Blog
  • phonegap
  • PHP Frameworks
  • php-jquery
  • system
  • Wordpress
  • Yii

Post navigation

Previous post

how to use Curl in php

Next post

how to use ajax in wordpress


PHPSOFT SOLUTIONS LOGO

Our mission is to satisfy our customers to the best.Money is the source nowdays, the trust of how we can use your money in the best way is build by us.The core value of php soft solutions is to provide the best service to our customers in a great manner.

Contact

PLOT NO. C157, The Groove, Industrial focal point, Phase7,MOHALI, SAS Nagar, Punjab, 160055

8146501814

contact@phpsoftsolutions.in

Pages Links
  • WordPress
  • Yii
  • PHP Frameworks
  • php-jquery
  • system
  • phonegap

© 2025 PHPSOFT SOLUTIONS