문제

I want to create an app with phonegap and zepto chosen because light.

The will be large and for easly development and future mantainance will be divided in several different pages.

I do not understand if will be better call by ajax the different page from the main index page of the app and inizialize zepto in the main page or i can add zepto js to every page. phonegap do this for every page and my target is create an app hosted in phonegap.

Thanks for your time and for apprecited help.

도움이 되었습니까?

해결책

It depends where you need zepto. What you should do is add it on every page, and only include it in the whole file once. I organize mine by having the pages reference "../js/src/zepto.js" or something along those lines. Don't include zepto multiple times in the file, but do call it on every page.

다른 팁

Zepto isn't there to provide structure. I think you maybe looking for Backbone instead. http://backbonejs.org/#

I suggest your first idea: "call by ajax the different page from the main index page of the app and inizialize zepto in the main page"

This way, you are in complete control of making the user experience smooth, seamless, and application-like.

@stevew's suggestion on Backbone is good--it's a strong structural framework and if your application is large, I think you'll find it useful, although there's some learning curve to figure out how best to leverage it.

Phonegap is a wrapper around whatever you create, so you don't need to worry about it for now.

Good luck.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top