标签:1.4 elf AC fun script list 网页 question over
原文:vs2017 js cordova + dotnet core 开发app1.记得在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.控件click事件绑定
document.querySelector(‘#button1‘).addEventListener(‘click‘, function () {
$.get("http://192.168.1.102:5000/api/values", function (result) {
alert(result);
});
});
3.dotnet core项目中program.cs设置开启运行外部访问
添加.UseUrls("http://*:5000")
如下
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.移动设备webview浏览网页需要在config.xml中添加 <allow-navigation href="*" />
<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 开发app
标签:1.4 elf AC fun script list 网页 question over
原文地址:https://www.cnblogs.com/lonelyxmas/p/9005012.html