简体   繁体   English

如何确保phonegap js在具有多个单独页面的应用程序中仅加载一次?

[英]how to do to make sure phonegap js load just once time in an app with many separate pages?

Use phonegap 1.6,now called cordova 1.6, with jquery mobile 1.0.1,but I feel performance is a problem. 使用带有jQuery mobile 1.0.1的phonegap 1.6(现在称为cordova 1.6),但我觉得性能有问题。 Also with some other js libs,such as iscroll.js, plus the performance problem. 还有其他一些js库,例如iscroll.js,还有性能问题。

Can I load phonegap js just once,and later all pages can still use phonegap api? 我可以只加载一次phonegap js,以后所有页面仍可以使用phonegap api吗?

I have an idea that Page A load phonegap js ,and nested iframe refer Page B. Page B will replace by other pages. 我有一个想法,即页面A加载phonegap js,而嵌套的iframe引用页面B。页面B将被其他页面替换。 Can Pages in iframe use its parent phonegap api? iframe中的页面可以使用其父phonegap API吗?

eg: parent.(all phonegap api) 例如:parent。(所有phonegap api)

You can use jQuery Mobile data-role="page" to define multiple pages on a single html page with one phonegap.js load. 您可以使用jQuery Mobile data-role =“ page”在单个HTML页面上定义多个页面,并加载一个phonegap.js。

See the docs at http://jquerymobile.com/demos/1.1.0/docs/pages/page-anatomy.html 请参阅http://jquerymobile.com/demos/1.1.0/docs/pages/page-anatomy.html上的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM