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.
var xmlHttp
function showUser(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getuser.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
<html>
<head>
<script src="selectuser.js"></script>
</head>
<body>
<a href="#" onclick="showUser(1)">Blaaaa</a><br>
<a href="#" onclick="showUser(2)">Blaaaa2</a><br>
<a href="#" onclick="showUser(3)">Blaaaa3</a><br>
<p>
<div id="txtHint"><b>Tuka shte izpishe kfo e stanalo</b></div>
</p>
</body>
</html>
<?php
$q=$_GET["q"];
if($q == 1){
echo "blaaaa";
}
if($q == 2){
echo "blaaaa2";
}
if($q == 3){
echo "blaaaa3";
}
if($q == 4){
echo "blaaaa4";
}
?>