Talking about Instant Paging Technology under Web
Under Web (not considering using an ActiveX control) Instant paging is generally based on "pull" technology, that is, get the latest message to the server every other period, and then reflects to the client, based on "pull" technology, usually a few Form:
Frame / iframe Refresh: Generally, use a hidden iframe / frame page, scheduled refresh, get the latest message from the server, and perform the script, reflect the message to the client. The advantage of this approach is compatible, suitable for all browsers that support Frame and scripts, the disadvantage is because it is direct refresh, it is possible to have "bar" sound every time, if the browser The status bar can be seen that the above progress bar will flash, which is more annoying. For example, Microsoft's latest MSN Web Messenger is based on this technology. XMLHTTP / XMLDOM No refresh: This unfiffinated technology makes web developers. On the client, Xmldom can get the server-side XML file according to the URL and return to an XMLDocument, while XMLHTTP can also get XML and HTML, but also send an XMLDocument to the server, but also combined with the client script: setTimeout (" Function () ", timeoutInterval), get data from the server from the server. In particular, pay attention is that, regardless of XMLDOM or XMLHTTP, there are "synchronous" and "asynchronous", if it is "synchronous", the browser will wait until all the acquired XML is completely downloaded to continue, if it is "asynchronous ", The browser will continue the next step directly. For web instant paging, it is recommended to use "asynchronous" mode, because "synchronization" mode is likely to cause the browser "false" situation, it is very unfriendly. Use "asynchronous" to avoid this problem, then you can determine if you have already loaded in the OnReadyStateChange event, then parsing the message. The advantage of this way is that the browser does not feel that the browser is refreshed, and the disadvantage is that the client is IE, and MSXML is installed, so compatibility is not very good. BTW: I heard that ASP.NET 2.0 has been encapsulated in this non-refresh, but unfortunately did not tried it. I don't know how to compatibility :) Script calls WebService Non-refresh: WebService is a good thing, JS can also call WebSerice, Microsoft has one WebService.htc, will package the call of WebService, which can be very convenient, in fact, even without WebService.htc, we can also parse themselves, because WebService is inherently XML, and can be parsed in combined with XMLDom in the client. Then use the timer or not refreshed to obtain server-side messages. The advantages and disadvantages of this approach are similar to the second way. There are a chat room in foreign countries is this technology used.