单页应用程序仅是整个Web应用程序使用的一页吗? [英] Is Single page application just one page using for entire web application?

查看:68
本文介绍了单页应用程序仅是整个Web应用程序使用的一页吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习单页应用程序,并且在阅读文档后本身

I'm learning about single page application and after read document itself

我想知道单页应用程序模式只是Web应用程序中使用外部模板敲除的一页(例如html页面)吗?

I wonder that single page application pattern is just one page(e.g: html page) in web application using knockout with external template?

我的意思是(我正在使用MVC):

I mean ( i'm using MVC ):

-mywebsite
 + some js files
 + some css files
 + index.html
 + controllers
 + models

我希望有人能为我更多地解释这种模式.谢谢.

I hope someone can explain for me more about this pattern.Thanks.

推荐答案

是的,通常,您有一个HTML页面作为外壳",其中包含加载到该外壳"中的信息视图. JavaScript文件充当调出获取此数据,解析数据并将模板应用于数据的媒介.与意大利面条式JavaScript代码相反,模型,控制器等允许对JavaScript结构使用模块方法. CSS具有与平常相同的目的.

Yes, you generally have a single HTML page that acts as a "shell" that has views of information loaded into that "shell". The JavaScript files act as the medium to call out to get this data, parse the data and apply templates to the data. Models, controllers, etc. allow for a module approach to the JavaScript structure, as opposed to spaghetti JavaScript code. CSS serves the same purpose as usual.

在我看来,这是纯AJAX应用程序在大约10年前的目标,即加载单个页面,然后仅对服务器或服务的请求将加载数据,仅执行部分页面更新而不是回传到服务器以呈现(或重新呈现)页面(就像WebForms一样).

In my opinion, it is what pure AJAX applications were intended to be about 10 years ago, where a single page would load and then only requests to the server or services would load data, only performing partial page updates instead of posting back to the server to render (or re-render) the page (like WebForms does).

更新:

单页应用程序:KnockoutJS模板包含KnockoutJS,但还有其他选项,详情请参见了解除以下以外的库淘汰赛?,它列举了网格中每个模板的功能,以便于查看.

The Single Page Application: KnockoutJS template incorporates KnockoutJS, but there are other options as detailed in Know a library other than Knockout?, which enumerates the features of each template in a grid for easy viewing.

这篇关于单页应用程序仅是整个Web应用程序使用的一页吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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