ajax能使web应用程序有状态吗?

时间:2022-03-16 16:22:44

Ajax can return the information on a browser without the need of a refresh. Does it mean it stores ID in a session/ stateful behaviour? I don't see any change in the URL in a web application which is based on Ajax. Example I am looking at is - http://evolvingweb.github.io/ajax-solr/examples/reuters/index.html. I am trying to compare an UI developed in ASP.NET MVC which is stateless vs. when a UI developed in javascript framework with ajax

Ajax可以在不需要刷新的情况下返回浏览器上的信息。是否意味着它在会话/状态行为中存储ID ?我没有看到基于Ajax的web应用程序中的URL有任何变化。我正在看的例子是:http://evolvingweb.github.io/ajax-solr/examples/reuters/index.html。我试图比较在ASP中开发的UI。NET MVC,它是无状态的,与ajax在javascript框架中开发的UI相比。

2 个解决方案

#1


3  

HTTP is a stateless protocol. From Http RFC:

HTTP是无状态协议。从Http RFC:

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.

超文本传输协议(HTTP)是分布式、协作、超媒体信息系统的应用层协议。它是一种通用的、无状态的协议,它可以用于超文本(如名称服务器和分布式对象管理系统)之外的许多任务,通过扩展它的请求方法、错误代码和标头。HTTP的一个特性是数据表示的输入和协商,允许独立于传输的数据构建系统。

Ajax isn't as you are thinking about: From W3C:

Ajax并不像您所想的那样:来自W3C:

AJAX = Asynchronous JavaScript and XML.

AJAX =异步JavaScript和XML。

AJAX is a technique for creating fast and dynamic web pages.

AJAX是一种创建快速和动态web页面的技术。

AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

AJAX允许通过在幕后与服务器交换少量数据来异步更新web页面。这意味着可以在不重新加载整个页面的情况下更新web页面的某些部分。

Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.

传统的web页面(不使用AJAX)必须在内容发生变化时重新加载整个页面。

ASP.NET State Management can be done using Cookies, Session, Browser Cache (HTML5 provide Browser DataBase for Caching Today), Profile, SQL Server Cache, QueryStrings, HiddenFields.

ASP。NET状态管理可以使用cookie、会话、浏览器缓存(HTML5提供浏览器数据库缓存)、配置文件、SQL Server缓存、QueryStrings、HiddenFields。

There's a new trend to build Web Applications that are responsive to user, SPA (Single Page Application) that provides a awesome user experience using Ajax and MVVM frameworks build in JavaScript.

现在有一种新的趋势来构建Web应用程序,它可以响应用户、SPA(单页应用程序),它提供了使用Ajax和MVVM框架构建JavaScript的出色用户体验。

The guy behind SPA, using Microsoft ASP.NET MVC, is Jonh Papa.

SPA背后的家伙,使用微软的ASP。NET MVC,是Jonh Papa。

#2


0  

I would say, yes, it does make a page stateful.

我会说,是的,它确实是一个有状态的页面。

As I understand it you could:
set a javascript variable myGlobal = "current value",
then remove e.g., "<div id='content'>" and replace it with new content,
and the variable myGlobal could still be used and its value would remain.

正如我所理解的那样,您可以:设置一个javascript变量myGlobal = "当前值",然后删除例如"

'并替换为新的内容,变量myGlobal仍然可以使用,它的值将保持不变。

That seems like state to me.

这对我来说似乎是一种状态。

#1


3  

HTTP is a stateless protocol. From Http RFC:

HTTP是无状态协议。从Http RFC:

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.

超文本传输协议(HTTP)是分布式、协作、超媒体信息系统的应用层协议。它是一种通用的、无状态的协议,它可以用于超文本(如名称服务器和分布式对象管理系统)之外的许多任务,通过扩展它的请求方法、错误代码和标头。HTTP的一个特性是数据表示的输入和协商,允许独立于传输的数据构建系统。

Ajax isn't as you are thinking about: From W3C:

Ajax并不像您所想的那样:来自W3C:

AJAX = Asynchronous JavaScript and XML.

AJAX =异步JavaScript和XML。

AJAX is a technique for creating fast and dynamic web pages.

AJAX是一种创建快速和动态web页面的技术。

AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

AJAX允许通过在幕后与服务器交换少量数据来异步更新web页面。这意味着可以在不重新加载整个页面的情况下更新web页面的某些部分。

Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.

传统的web页面(不使用AJAX)必须在内容发生变化时重新加载整个页面。

ASP.NET State Management can be done using Cookies, Session, Browser Cache (HTML5 provide Browser DataBase for Caching Today), Profile, SQL Server Cache, QueryStrings, HiddenFields.

ASP。NET状态管理可以使用cookie、会话、浏览器缓存(HTML5提供浏览器数据库缓存)、配置文件、SQL Server缓存、QueryStrings、HiddenFields。

There's a new trend to build Web Applications that are responsive to user, SPA (Single Page Application) that provides a awesome user experience using Ajax and MVVM frameworks build in JavaScript.

现在有一种新的趋势来构建Web应用程序,它可以响应用户、SPA(单页应用程序),它提供了使用Ajax和MVVM框架构建JavaScript的出色用户体验。

The guy behind SPA, using Microsoft ASP.NET MVC, is Jonh Papa.

SPA背后的家伙,使用微软的ASP。NET MVC,是Jonh Papa。

#2


0  

I would say, yes, it does make a page stateful.

我会说,是的,它确实是一个有状态的页面。

As I understand it you could:
set a javascript variable myGlobal = "current value",
then remove e.g., "<div id='content'>" and replace it with new content,
and the variable myGlobal could still be used and its value would remain.

正如我所理解的那样,您可以:设置一个javascript变量myGlobal = "当前值",然后删除例如"

'并替换为新的内容,变量myGlobal仍然可以使用,它的值将保持不变。

That seems like state to me.

这对我来说似乎是一种状态。