IBM工作灯6.1 - 如何打开链接? [英] IBM Worklight 6.1 - How to open links?
问题描述
我已经使用这个 WL.App.openURL('链接','_空白')
。
在我的应用程序,我有一些超链接。当点击一个链接,它加载的应用程序本身相关页面。
我如何做到这一点?
您的不当使用API ...
您有2个选项:
-
使用<一个href=\"http://cordova.apache.org/docs/en/3.1.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser\"相对=nofollow>科尔多瓦的InAppBrowser API
这样就可以显示一个浏览器窗口ontop的应用程序;完成后你点击一个按钮来关闭并返回到应用程序。这code片断如下:
&LT; A HREF =#的onclick =window.open('http://apache.org','_blank','位置= YES')&GT;访问Apache.org&LT; / A&GT ;;
块引用> -
阅读<一href=\"http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/09_07_Integrating_server_generated_pages_in_Worklight_applications.pdf\"相对=在混合应用培训模块nofollow的>集成服务器生成的页面,检查<一个href=\"http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v610/IntegratingServerGeneratedPagesProject.zip\"相对=nofollow>示例项目
这样你可以加载应用程序的web视图内的外部URL。
有关你的情况选择1似乎是解决方案中使用。
I have tried using this WL.App.openURL('link','_blank')
.
In my app, I have some hyperlinks. Upon clicking a link, it has to load respective pages in the app itself.
How do I accomplish this?
You are mis-using the API...
You have 2 options:
Use Cordova's InAppBrowser API
This way you can display a browser window ontop of the app; when done you tap a button to close it and return to the app. This code snippet works:
<a href="#" onclick="window.open('http://apache.org', '_blank', 'location=yes')">visit Apache.org</a>;
Read the Integrating server-generated pages in hybrid applications training module and inspect the sample project
This way you can load an external URL within the application's WebView.
For your case option 1 seems the solution to use.
这篇关于IBM工作灯6.1 - 如何打开链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!