IBM Worklight 6.1 - Why is Cordova code not working when placed in a sub-page?

我与影子孤独终老i 提交于 2020-01-20 09:33:24

问题


I tried out the Cordova camera example inside my Worklight application.
It works only when the camera code is inside the main HTML file (index.html).

When I place it in another HTML file, it does not work.
Why is that? What am I missing?


回答1:


Worklight is a Single Page Application. Thus you cannot simply load another HTML file and expect your application to continue functioning; this includes Cordova.

Read the "Building a multi-page application" training module and review the accompanying sample project, to better understand how to create a multi-page application.

You can also review these sample applications (after reading the training module):

  • JQM_multipage_load_changePage.zip - uses either .load or .changePage
  • JQM_multipage_changePage_pageshow.zip - uses .changePage and .pageShow


来源:https://stackoverflow.com/questions/21747801/ibm-worklight-6-1-why-is-cordova-code-not-working-when-placed-in-a-sub-page

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