Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
На мен ми трябва само кода за презареждане, а не цял чат.F1r3Fl3x каза:Пробвай с това
<script language="JavaScript">
function createRequestObject(){
var request_;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_ = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_ = new XMLHttpRequest();
}
return request_;
}
var http = new Array();
var http2 = new Array();
function getInfo(){
var curDateTime = new Date();
http[curDateTime] = createRequestObject();
http[curDateTime].open(\'get\', \'refresh.php\');
http[curDateTime].onreadystatechange = function(){
if (http[curDateTime].readyState == 4)
{
if (http[curDateTime].status == 200 || http[curDateTime].status == 304)
{
var response = http[curDateTime].responseText;
document.getElementById(\'view_ajax\').innerHTML = response;
}
}
}
http[curDateTime].send(null);
}
function getInfo2(){
var curDateTime = new Date();
http2[curDateTime] = createRequestObject();
http2[curDateTime].open(\'get\', \'submit.php?chat=\'+ document.ajax.chat.value);
http2[curDateTime].send(null);
}
function send(){
getInfo2();
document.ajax.chat.value=" ";
}
function go(){
getInfo();
window.setTimeout("go()", 2000);
}
</script>