![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 215 Pomógł: 0 Dołączył: 12.03.2007 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Jak zrobić tak, że jak kliknę w w jakiś text to z pod niego wyjedzie napis. Takie jakby rozsuwane menu, ale ja chce, żeby to był ajax. Pozdrawiam |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 81 Pomógł: 2 Dołączył: 26.10.2005 Ostrzeżenie: (0%) ![]() ![]() |
Robisz 3 pliki :
1. forum.html 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
I dziala (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Pozdro, mam nadzieje, ze to jest to o co Ci chodzilo |
|
|
![]() ![]() |
![]() |
Aktualny czas: 9.10.2025 - 02:44 |