Refresh technology has gone through several stages:
1. Add a key to the HTML file header to make the page jump to the specified page (including itself) after a set time;
for example:
<meta http-equiv="refresh " content="30">
2. Use the frame and refresh the frame content regularly in the JS script.
The above two methods will reload the page, that is, refresh, which does not feel very good! So refreshless technology appeared.
Third, it is a modification of the second method.
That is, set the length and width of one of the many frames to 0 to make it invisible, then regularly refresh the content of the hidden frame through a script, and then "write" the content of the frame into a browsable frame. Most early chat rooms used this technology.
In the true sense, the following two technologies are used to achieve refreshless technology, which can even achieve partial refresh:
4. xmlHttp technology, which can access asp pages, aspx pages, WebService, etc. through xmlHttp.
<script language="javascript">
functionre()
{
var http = new ActiveXObject("Microsoft.XMLHTTP");
http.open("GET","../Advertisement/3.htm",false);
http.send();
var str = http.responseText;
t.innerHTML=str;
}
</script>
<span id=t></span>
5. WebService, use the WebService.htc component to access the Web service.
varOBJ;
function init(obj,op,id)
{
OBJ=obj;
OBJ.useService("admin/DataOperation.asmx?WSDL","getBody");
OBJ.getBody.callService(show,op,id);
}
function show(result){
OBJ.innerHTML=result.value;
}
6. Remoting, using Remoting can also achieve refreshless technology. Because the Remoting component can provide multiple access methods including Http, it is equivalent to a WebService when accessed as Http.