У меня есть приложение phonegapp, связанное с API, размещенным на геройку. Я использую Codio, а Canary - как эмулятор. Когда я загружаю инструменты google chrome для просмотра моего приложения, он подключается, как я смотрю на вкладке «Сеть»; это дает мне эти 3 ошибки;Определить доступ к внешним доменам в Phonegap
(index):98 GET http://pinball-spring.codio.io:35729/livereload.js?snipver=1 net::ERR_CONNECTION_TIMED_OUT
(index):1 XMLHttpRequest cannot load http://venuetoronto.herokuapp.com/api/v1/neighbourhoods. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://pinball-spring.codio.io:8100' is therefore not allowed access.
(index):1 XMLHttpRequest cannot load http://venuetoronto.herokuapp.com/api/v1/search/meta. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://pinball-spring.codio.io:8100' is therefore not allowed access.
Я просмотрел PhoneGap/апач/Cordova документов, и он говорит, что для белого списка домена (который является то, что я думаю, что я пытаюсь сделать); зайти в файл config.xml и показать это;
<!--
Define access to external domains.
<access /> - a blank access tag denies access to all external resources.
<access origin="*" /> - a wildcard access tag allows access to all external resource.
Otherwise, you can specify specific domains:
-->
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
<!--
<access origin="http://phonegap.com" /> - allow any secure requests to http://phonegap.com/
<access origin="http://phonegap.com" subdomains="true" /> - same as above, but including subdomains, such as http://build.phonegap.com/
<access origin="http://phonegap.com" browserOnly="true" /> - only allows http://phonegap.com to be opened by the child browser.
-->