Robisz 3 pliki :
1. forum.html
<div onclick="showHint('parametr')">Kliknij na mnie
</div>
2. forum.js
Kod
var xmlHttp
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="forum.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)
{
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;
}
3. forum.php
<?php
header("Cache-Control: no-cache, must-revalidate"); // Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
//get the q parameter from URL
$q=$_GET["q"];
//lookup all hints from array if length of q>0
{
//jak cos od prarametru bys chcial zrobic
}
//output the response
// moze byc string lub zmienna ktora stringa zawiera
echo 'co ma sie wyswietlic'; ?>
I dziala

Pozdro, mam nadzieje, ze to jest to o co Ci chodzilo