first, by default, Cordova cannot directly use Ajax to request access to other data in the page.
Exception 1:
Ripple.js:51 refused to connect to ' Http://localhost:59201/api/category/getlistbyparent? Projectcode=lc_app_v1 ' because it violates the following Content Security Policy directive: "Default-src ' self ' data:gap: Https://ssl.gstatic.com ' Unsafe-eval ' ". Note that ' connect-src ' was not explicitly set, so ' default-src ' is used as a fallback.
Solution:
page-level configuration , allowing the page's connect to request the other data
Set the Content-security-policy CONNECT-SRC *;
Examples are as follows:
<meta http-equiv= "Content-security-policy" content= "default-src ' self ' data:gap:https://ssl.gstatic.com ' Unsafe-eval '; Style-src ' self ' unsafe-inline '; MEDIA-SRC *;CONNECT-SRC *; " >
Exception 2:
ripple.js:51 OPTIONS Http://localhost:4400/ripple/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rur...//localhost %3A59201/API/CATEGORY/GETLISTBYPARENT%3FPROJECTCODE%3DLC_APP_V1 net::err_connection_refused
and exception 3 issues with Internet Server error:
Error code Is:xhr_proxy?tinyhippos_apikey=abc&tinyhippos_rurl=http%3a//localhost%3a30673/ap? i/user/Get% 3Fjson rippleapi.herokuapp.com Status code:500 Internal Server Error I ' am getting data from my localhost post adress:local Host:30673/api/user/get '; It is the working well in browser. And getting data from Localhost:30673/api/user/get. Ripple it tries to get data from there:xhr_proxy?tinyhippos_apikey=abc&tinyhippos_rurl=http%3a//localhost% 3a30673/api/u? Ser/get%3fjson rippleapi.herokuapp.com
Solution:
Ripple Configuration
Ipple settings There is a cross Domain Proxy in the upper right corner, with three choices, Disabled, local, and remote, which can be literally seen to be disabled, locally and remotely accessible, if you are accessing the native API. It is generally set to disabled. If you access the remote host's API, it is generally set to either remote or disabled.
Exception 4: Common Ajax cross-domain issues, this is primarily server-side configuration, can be consulted: Enable ASP. WEBAPI support for JSONP and Cors cross-domain access
Related article: http://www.it165.net/pro/html/201608/74401.html
More:
Cordova Config configuration webview full screen browsing
Cordova-plugin-themeablebrowser plug-in use collation
Cordova page Load External screen picture failed, refused to load the image