Ajax异步刷新。可能吗 ? [英] Ajax Asynchronous refresh. Is it possible ?

查看:72
本文介绍了Ajax异步刷新。可能吗 ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




假设我有一个服务器进程,用于监听数据库中的一些更改。

当发生更改时,我想刷新我的页面浏览器通过notyfinig吧。


我不想刷新我的页面,即每5秒,我只想

刷新它只在服务器上更改就像桌面应用程序确实如此。


问题是刷新evry n秒对我的

Web服务器有很大的影响。刷新动作应该只在某些事情真正发生时才有意义


有可能吗?


问候,彼得

Hi,

Say i have a server process which listens for some changes in database.
When a change occurs i want to refresh my page in browser by notyfinig it.

I do not want to refresh my page i.e. every 5 seconds, i just want to
refresh it ONLY on server change just like desktop applications do.

The problem is that refreshing evry n seconds has to much impact on my
web server. The refresh action should be taken only when something
really happens that makes sense

Is it possible ?

greets, peter

推荐答案

我认为这是不可能的,你不能通知一个Web浏览器客户端,它在服务器上发生了变化。这就是网站和网站的性质,它们是无国籍的。


" Piotr Nowak"写道:
I dont think that is possible, you cant "notify" a web browser client that
something has changed on the server. That is the nature of web sites and web
applications, they are "stateless".

"Piotr Nowak" wrote:




假设我有一个服务器进程,可以监听数据库中的一些更改。

当发生变化时,我想通过notyfinig在浏览器中刷新我的页面。


我不想刷新我的页面,即每5秒,我只想

仅在桌面应用程序更新时才刷新服务器。


问题是刷新evry n秒对我的影响很大

网络服务器。刷新动作应该只在某些事情真正发生时才有意义


有可能吗?


greets,peter
Hi,

Say i have a server process which listens for some changes in database.
When a change occurs i want to refresh my page in browser by notyfinig it.

I do not want to refresh my page i.e. every 5 seconds, i just want to
refresh it ONLY on server change just like desktop applications do.

The problem is that refreshing evry n seconds has to much impact on my
web server. The refresh action should be taken only when something
really happens that makes sense

Is it possible ?

greets, peter


NH pisze:
NH pisze:

我不认为这是可能的,你不能"通知"一个Web浏览器客户端,它在服务器上发生了变化。这就是网站和网站的性质,它们是无国籍的。


" Piotr Nowak"写道:
I dont think that is possible, you cant "notify" a web browser client that
something has changed on the server. That is the nature of web sites and web
applications, they are "stateless".

"Piotr Nowak" wrote:

>

说我有一个服务器进程,它会监听数据库中的一些变化。
当一个发生了变化我想在浏览器中通过notyfinig刷新我的页面。

我不想刷新我的页面,即每5秒,我只想刷新它只在服务器更改上就像桌面应用程序一样。

问题是刷新evry n秒对我的网络服务器有很大的影响。刷新动作应该只在真正发生的事情发生时才有意义

是否可能?

greets,peter
>Hi,

Say i have a server process which listens for some changes in database.
When a change occurs i want to refresh my page in browser by notyfinig it.

I do not want to refresh my page i.e. every 5 seconds, i just want to
refresh it ONLY on server change just like desktop applications do.

The problem is that refreshing evry n seconds has to much impact on my
web server. The refresh action should be taken only when something
really happens that makes sense

Is it possible ?

greets, peter



无状态意味着没有关于先前请求的信息在

新的那个,它被遗忘了。

i只想得到一个简单的

更新我的客户端浏览器视图时,从服务器响应。

stateless means that theres no information about previous request in the
new one, its forgotten.
i just want to get one simple response right from the server when
something happens to update my client browser view.


只要有一些asp.net代码就可以了对于正在更新的服务器,运行将返回true或

false,这是可能的。每隔x秒使用ajax

调用,当它返回true时,通过

javascript重新加载页面。


" Piotr诺瓦克" < p。****** @ STRIPTHISwasko.plwrote in message

news:fa ********** @ atlantis.news.tpi.pl ...
As long as there is some asp.net code you can run that will return a true or
false as to the server being updated then this is possible. Use an ajax
call every x seconds and when it returns true issue a page reload via
javascript.

"Piotr Nowak" <p.******@STRIPTHISwasko.plwrote in message
news:fa**********@atlantis.news.tpi.pl...




假设我有一个服务器进程监听数据库中的一些更改。

当发生变化时,我想通过notyfinig在浏览器中刷新我的页面。


我不想刷新我的页面,即每5秒,我只想要

仅在桌面应用程序上更新服务器更新。


问题是令人耳目一新的时间对我的网络有很大的影响

服务器。刷新动作应该只在真正有意义的事情发生时才有意义


有可能吗?


greets,peter
Hi,

Say i have a server process which listens for some changes in database.
When a change occurs i want to refresh my page in browser by notyfinig it.

I do not want to refresh my page i.e. every 5 seconds, i just want to
refresh it ONLY on server change just like desktop applications do.

The problem is that refreshing evry n seconds has to much impact on my web
server. The refresh action should be taken only when something really
happens that makes sense

Is it possible ?

greets, peter



这篇关于Ajax异步刷新。可能吗 ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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