just-for-funn Posted August 17, 2012 Report Posted August 17, 2012 Bun, deci am un table, ex mai jos, si asi vrea ca atunci cand dau click pe "Button01" daca este cumva posibil, vreau ca toate celelalte cell`s de pe randul ala sa isi dea refresh.Aveti careva idee cum ais putea face, am cautat pe diferite site-uri dar nu am gasit nimic sa mearga ... <table border="1" bordercolor="black" style="background-color:grey" width="355" cellpadding="1" cellspacing="1"> <tr> <td>Button01</td> <td>Button02</td> </tr> <tr> <td>Refresh01</td> <td>Refresh02</td> </tr> <tr> <td>Refresh01</td> <td>Refresh02</td> </tr> <tr> <td>Refresh01</td> <td>Refresh02</td> </tr></table> Quote
sharkyz Posted August 17, 2012 Report Posted August 17, 2012 https://www.google.gr/#hl=en&gs_nf=1&tok=NlpWk3mfBcWFRRygIKaNBA&cp=19&gs_id=3a&xhr=t&q=onclick+refresh+div&pf=p&sclient=psy-ab&oq=onclick+refresh+div&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=abb9b6000a83dedd&biw=1440&bih=787 Quote
Sim Master Posted August 17, 2012 Report Posted August 17, 2012 N-ai dat prea multe detalii. De ce sa isi dea refresh? Ce se va schimba dupa refresh? Quote
just-for-funn Posted August 17, 2012 Author Report Posted August 17, 2012 (edited) Asta e site`ul: http://haarpjd.square7.ch/ vreau sa pun in fata la Realm un buton care sa dea refresh la toate cell`s !De exemple am pus ca default "Looking for Realm ..." apoi cand dai refresh sa se schimbe in functie de realm`ul care il pun la faction in loc de "Looking for Realm ..." Edited August 17, 2012 by just-for-funn Quote
Sim Master Posted August 17, 2012 Report Posted August 17, 2012 Va trebui sa faci requesturi ajax ca sa obtii rezultatul unei pagini. Exemplu:pagina1.html care contine codul, tabelul, etc cu tot cu scriptul ajax.<script type="text/javascript">function checkPlayer(){ var http; if (window.XMLHttpRequest) { http = new XMLHttpRequest(); } else { http = new ActiveXObject("Microsoft.XMLHTTP"); } http.onreadystatechange = function() { if (http.readyState == 4) { document.getElementById('player1').innerHTML = http.responseText; } } http.open("GET", "pagina2.html", true); http.send();}</script><span id="player1">Looking for realm</span><input type="button" value="Button01" onclick="checkPlayer();">si pagina2.html care contine doar raspunsul care sa fie afisat in celulele de tabel:Realm 1337Le pui pe server si testezi. Quote
section11 Posted August 20, 2012 Report Posted August 20, 2012 incearca ajax folosing jquery, e mai greu normal, si nu pari sa stii prea mult despre ce este vorba Quote
BLKoldSUN Posted September 7, 2012 Report Posted September 7, 2012 Citeste aici: <a href="http://www.webdeveloper.com/forum/showthread.php?169337-Auto-refresh-lt-DIV-gt-using-ajax">Ajax auto refresh</a> Quote