Original: vs2017 JS Cordova + dotnet Core Development app
1. Remember to join in index.html
<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 *; " >
<script type= "Text/javascript" src= "Scripts/jquery-2.1.4.min.js" ></script>
2. Control Click event Bindings
Document.queryselector (' #button1 '). AddEventListener (' click ', function () {
$.get ("Http://192.168.1.102:5000/api/values", function (Result) {
alert (result);
});
});
3.dotnet Core Project Program.cs setting on run external access
Add to. Useurls ("http://*:5000")
As follows
public static void Main (string[] args)
{
var host = new Webhostbuilder ()
. Usekestrel ()
. Useurls ("http://*:5000")
. Usecontentroot (Directory.GetCurrentDirectory ())
. Useiisintegration ()
. Usestartup<startup> ()
. Useapplicationinsights ()
. Build ();
Host. Run ();
}
}
4. Mobile device WebView Browsing the web requires adding <allow-navigation href= "*" to config./>
<p>
<a href= "http://www.baidu.com" >jump web</a>
</p>
Http://stackoverflow.com/questions/36036475/cordova-6-0-ios-load-external-url-in-the-webview
vs2017 JS Cordova + dotnet Core Development app