IBM Worklight 6.1 - How to open links?

一曲冷凌霜 提交于 2019-12-23 04:26:24

问题


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?


回答1:


You are mis-using the API...

You have 2 options:

  1. 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>;
    
  2. 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.



来源:https://stackoverflow.com/questions/22075184/ibm-worklight-6-1-how-to-open-links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!