IBM Worklight 6.1 - 为什么Cordova代码放置在子页面时无法正常工作? [英] IBM Worklight 6.1 - Why is Cordova code not working when placed in a sub-page?

查看:111
本文介绍了IBM Worklight 6.1 - 为什么Cordova代码放置在子页面时无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Worklight中试用了 Cordova相机示例应用程序。
只有当相机代码位于主HTML文件(index.html)内部时,它才会工作。

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).

当我将它放在另一个HTML文件中时不工作。
为什么?我缺少什么?

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

推荐答案

Worklight是单页应用程序。因此,您不能简单地加载另一个HTML文件,并希望您的应用程序继续运行;

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

这篇关于IBM Worklight 6.1 - 为什么Cordova代码放置在子页面时无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆