XDK - 在浏览器中打开链接而不使用Cordova [英] XDK - open link in browser without using Cordova
问题描述
我希望您通过不在Appview中的浏览器在我的应用中打开链接。我通过xdk制作我的html5移动应用程序。我不想在我的应用程序中使用cordova,因为我的应用程序很重要,并且不想因为只有一个链接而使它变重。
我看到了这个:
I want you to open a link in my app via browser not in Appview. I ma making my html5 mobile app via xdk. I don't want to use cordova in my app as my app is heavy enogh and don't want to make it heavier because of just one link. I saw this :
<a href="#" onclick="window.open('http://www.kidzout.com', '_system');">www.kidzout.com</a>
但问题是我必须安装Cordova InAppBrowser插件才能正常工作。如果不使用Cordova或外部插件,您有什么解决方案吗?您认为它有可能吗?
But the problem is I must install Cordova InAppBrowser plugin for this to work. Do you have any solution without using Cordova or external plugins? Do you think is it possible at all?
推荐答案
您可以在本机浏览器中打开链接(Mobile Safari,Android等) 。)来自HTML5移动应用程序,使用 intel.xdk API以前 AppMobi 。
You can open a link in the native browser(Mobile Safari, Android, etc.) from within a HTML5 Mobile app using the intel.xdk API formerly AppMobi.
在头部,包括对intelxdk.js文件的引用。
In the head, include a reference to the intelxdk.js file.
<script src="intelxdk.js"></script>
用于打开链接:
<a href="#" onclick="intel.xdk.device.launchExternal('http://www.intel.com');">Launch in Browser</a>
有关更多信息,请转到 http://www.html5dev-software.intel.com/documentation/jsAPI/device/launchExternal/index.html
For more information, go to http://www.html5dev-software.intel.com/documentation/jsAPI/device/launchExternal/index.html
这篇关于XDK - 在浏览器中打开链接而不使用Cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!