我在我的一个页面中使用多设备混合应用程序模板中的WinJS。但代码不能正常工作(下面是代码)。
HTML
<a id="facebook">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALIAAAAgCAYAAAC2JCIgAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByA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hyxkZ0MhEd3KHI3ylM5TBPGTpMQVdHWeNo9NRCJLG7VJl0XOawzqkANohzf4pwOxqZdgKEe02BG+6aSfp1BWCcBRC6YbkaSGA7Dvi4PVUW5nLf1VsGe45EXnesdTOFaxVp2+owRFYGLvJxyGrkfgXb3O3RyypIbgAw93NftWsP215wAcjvN22lQbMB4GexAQ19Jy8Ww/Qb4MUDqMMResi2h12ooa/5ZJt+9nv6///HJFGs3WfqhARziCfIWnvfx5jxGvrqVKyG/kfI6cjmnMf9j7QicuUj5vBR5fuUMQOnzQRcfpN7vnwGOkvGMWaS0vn4u4EUZHAY2+fgBO4Qlzv33aWTv7fnNuzcN+4D5sCVe+3+3wEAkUTd9qA5Y08AAAAASUVORK5CYII=" />
</a>
Javascript-
ready: function (element, options) {
// TODO: Initialize the page here.
document.getElementById("facebook").onclick = function () {
if (checkconnection())
document.getElementById("facebook").href = "https://www.facebook.com/amit.porwal.14";
else
Windows.UI.Popups.MessageDialog("Check your Network Connection").showAsync();
}
function checkconnection() {
var connectivity = Windows.Networking.Connectivity;
var profile = connectivity.NetworkInformation.getInternetConnectionProfile();
if (profile) {
return true;
}
else
return false;
}
当我没有使用checkconnection()函数时,该应用程序正常工作导航到Facebook网站。 因此在多设备混合模板中使用winjs有任何限制。 我正在android设备上调试这个。
我正在使用
Wins.xhr ,<x-ms-webview>
在我的应用中,但没有一个正常工作。
答案 0 :(得分:2)
任何以Windows。*开头的API都是WinRT API,并且不是 WinJS的一部分。 WinJS API始终以WinJS开头。; Windows。 API仅适用于Windows / Windows Phone 8 / 8.1,并且无法在Android上运行。
WinJS.xhr只是XMLHttpRequest的简单包装器,因此应该可以在任何具有DOM API的系统上运行。但是,你键入了Wins.xhr,所以也许你只是输错了。
至于,这也是特定于Windows应用主机的HTML元素,并且不是标准DOM的一部分。如果您要定位Android,则需要使用其HTML Webview等效功能。