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.
<div id="loadmsg" onkeyup="keyup(event.keyCode);">
<div id="loadwindow" onkeyup="keyup(event.keyCode);">
</div>
</div>
<script>
var waittime=100;
loadmsg.focus()
document.getElementById("loadwindow").innerHTML = "";
var xmlhttp = false;
var xmlhttp2 = false;
function ajax_read(url) {
if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
if(xmlhttp.overrideMimeType){
xmlhttp.overrideMimeType('text/xml');
}
} else if(window.ActiveXObject){
try{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e){
}
}
}
if(!xmlhttp) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4) {
document.getElementById("loadwindow").innerHTML = xmlhttp.responseText;
zeit = new Date();
ms = (zeit.getHours() * 24 * 60 * 1000) + (zeit.getMinutes() * 60 * 1000) + (zeit.getSeconds() * 1000) + zeit.getMilliseconds();
intUpdate = setTimeout("ajax_read('пътя до файла/load.php?x=" + ms + "')", waittime)
}
}
xmlhttp.open('GET',url,true);
xmlhttp.send(null);
}
/* Request for Writing the Message */
function ajax_write(url){
if(window.XMLHttpRequest){
xmlhttp2=new XMLHttpRequest();
if(xmlhttp2.overrideMimeType){
xmlhttp2.overrideMimeType('text/xml');
}
} else if(window.ActiveXObject){
try{
xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try{
xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
} catch(e){
}
}
}
if(!xmlhttp2) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
xmlhttp2.open('GET',url,true);
xmlhttp2.send(null);
}
/* Submit the Message */
function submit_msg(){
nick = document.getElementById("loadnick").value;
msg = document.getElementById("loadmsg").value;
if (nick == "") {
check = prompt("please enter username:");
if (check === null) return 0;
if (check == "") check = "anonymous";
document.getElementById("loadnick").value = check;
nick = check;
}
document.getElementById("loadmsg").value = "";
ajax_write("w.php?m=" + msg + "&n=" + nick);
}
/* Check if Enter is pressed */
function keyup(arg1) {
if (arg1 == 13) submit_msg();
}
/* Start the Requests! ;) */
var intUpdate = setTimeout("ajax_read('пътядофайла/load.php')", waittime);
</script>
<div id="loadmsg" onkeyup="keyup(event.keyCode);" style="width: 100px; height: 100px; border: 1px solid red;"> <div id="loadwindow" onkeyup="keyup(event.keyCode);" style="width: 100px; height: 100px; border: 1px solid red;"></div></div>
<script>
var waittime = 100;
var xmlhttp = false;
var xmlhttp2 = false;
function ajax_read( url ) {
if ( window . XMLHttpRequest ) {
xmlhttp = new XMLHttpRequest();
if ( xmlhttp . overrideMimeType ) {
xmlhttp . overrideMimeType( 'text/xml' );
}
}
else
if ( window . ActiveXObject ) {
try {
xmlhttp = new ActiveXObject( "Msxml2.XMLHTTP" );
}
catch ( e ) {
try {
xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" );
}
catch ( e ) {
}
}
}
if ( !xmlhttp ) {
alert( 'Giving up :( Cannot create an XMLHTTP instance' );
return false;
}
xmlhttp . onreadystatechange = function () {
if ( xmlhttp . readyState == 4 ) {
document . getElementById( "loadwindow" ) . innerHTML = xmlhttp . responseText;
zeit = new Date();
ms = ( zeit . getHours() * 24 * 60 * 1000 ) + ( zeit . getMinutes() * 60 * 1000 ) + ( zeit .
getSeconds() * 1000 ) + zeit . getMilliseconds();
intUpdate = setTimeout( "ajax_read('w.php?x=" + ms + "')",
waittime )}
}
xmlhttp . open( 'GET', url, true );
xmlhttp . send( null );
}
/* Request for Writing the Message */
function ajax_write( url ) {
if ( window . XMLHttpRequest ) {
xmlhttp2 = new XMLHttpRequest();
if ( xmlhttp2 . overrideMimeType ) {
xmlhttp2 . overrideMimeType( 'text/xml' );
}
}
else
if ( window . ActiveXObject ) {
try {
xmlhttp2 = new ActiveXObject( "Msxml2.XMLHTTP" );
}
catch ( e ) {
try {
xmlhttp2 = new ActiveXObject( "Microsoft.XMLHTTP" );
}
catch ( e ) {
}
}
}
if ( !xmlhttp2 ) {
alert( 'Giving up :( Cannot create an XMLHTTP instance' );
return false;
}
xmlhttp2 . open( 'GET', url, true );
xmlhttp2 . send( null );
}
/* Submit the Message */
function submit_msg() {
nick = document . getElementById( "loadnick" ) . value;
msg = document . getElementById( "loadmsg" ) . value;
if ( nick == "" ) {
check = prompt( "please enter username:" );
if ( check === null )
return 0;
if ( check == "" )
check = "anonymous";
document . getElementById( "loadnick" ) . value = check;
nick = check;
}
document . getElementById( "loadmsg" ) . value = "";
ajax_write( "w.php?m=" + msg + "&n=" + nick );
}
/* Check if Enter is pressed */
function keyup( arg1 ) {
if ( arg1 == 13 )
submit_msg();
}
/* Start the Requests! ;) */
var intUpdate = setTimeout( "ajax_read('w.php')", waittime );
window.onload = function(){
document.getElementById('loadmsg') . focus();
document . getElementById( "loadwindow" ) . innerHTML = "";
};
</script>