jquery移动多个html文件与多个页面 [英] jquery mobile multiple html files vs multiple page

查看:134
本文介绍了jquery移动多个html文件与多个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的phonegap / jquery移动应用程序中,使用了多页模型。
index.html包含我的应用程序的所有页面,目前为止6页。
如果这个应用程序增长太多而且在单个html文件中变成了19页,那会不会很糟糕?
我创建了其他应用来测试并使用一个html文件到每个页面。但看起来每次更改页面时,整个DOM都会再次加载,是吗?

In my phonegap/jquery mobile app, the multi page model is been used. index.html have all the pages of my app, so far 6 pages . If this app would grow too much and it turned to be 19 pages in a single html file, would it be bad? I created other app to test and used one html file to each page. But looks like every time the page is changed, the whole DOM is loaded again, is that right?

请告诉我哪个结构更适合大型应用

Please tell me which structure is better for a big app

推荐答案

如果将每个页面分成自己的html文件,您的代码将更易于维护和更新。

Your code will be easier to maintain and update if you break each page into its own html file.

有时您希望在每个页面之间进行动画处理,或者有一个输入表单,该表单具有多页面的错觉,但实际上是同一页面上的多个div。在这些和许多其他情况下,使用一个页面具有明显的优点。但是,如果您真的不需要这种功能,请将您的网站拆分。

Sometimes you want to animate between every page, or have an input form that has the illusion of being multiple pages but is in fact multiple divs on the same page. In these and many other cases, using one page has distinct advantages. If you have no real need for that kind of functionality, though, break apart your site.

这篇关于jquery移动多个html文件与多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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