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

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

问题描述

在我的 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 mobile 多个 html 文件 vs 多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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