When I use javascript to connect on local port like 127.0.0.1:8889, I have another symbian C++ send sth to this port. It works fine. But when I want to update the content for this port, the previous still there!!!! How this happened???
Even I reboot the machine, the content still on that port,when I get content by XMLhttprequest. How this happened? Anyone help me? Because I want to instanly update the content to that port!!
Anyone encounter this funny thing???
Who knows why the XMLhttprequest can save the content of last time? For example. the first time I use
http://127.0.0.1:8888/xxx.xml, it works fine, but when I update the xxx.xml, it still get the content before updating. Even after I restart my 5800, the XMLhttprequest.open still can works!!!!!! how?
This situation not exists in emulator.
the first time , I request the content in
http://127.0.0.1:8888/123.xml
then I updated the 123.xml
the second time, I request again to the new content,but I can not get the updated content,still the previous one
It works fine in Emulator,that I can receive F and F1 seperately, but not works on 5800 machine,I can only receive the F.it looks like there is a cache in the XMLhttprequest.open that all of the request with the same name just lead to the previous exist content.
----------------Here is the code----------------------------
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script language="JavaScript">
var xmlHttp = null;
function openConnection(){
try {
xmlHttp = new XMLHttpRequest;
xmlHttp.onreadystatechange = httpCallBack;
var url_frame = "http://127.0.0.1:8889/jjj.xml";
xmlHttp.open('GET', url_frame, false);
xmlHttp.send(null);
}
catch (e) {
}
}
function comeon(){
document.getElementById("to").innerHTML="jjj";
}
function httpCallBack()
{
if(xmlHttp.readyState != 4)
{
}
if ((xmlHttp.readyState == 4 )&&(xmlHttp.status == 200)) {
try
{
var resultXml = xmlHttp.responseText;
if(!resultXml){}
else
{ document.getElementById("do").innerHTML=resultXml;
var newdiv = document.getElementById("atom");
newdiv.innerHTML = xmlHttp.responseXML;
document.getElementById("to").innerHTML= resultXml.getElementsByTagName("to")[0].childNodes[0].nodeValue;
}
}
catch (e)
{
}
}
}
</script>
</head>
<body id="body">
<div id="go Peek">
<div id="greetingText">Welcome to Peek<br/>
<a class="link" href="javascript:comeon();">Click me</a>
</div>
</div>
<div id="atom"></div>
<p><b>To:</b> <span id="to"></span><br />
<p><b>Do:</b> <span id="do"></span><br />
<div>
<input type="button" value="PEEK GO" onClick="openConnection();" />
</div>
</body>
</html>