July 20, 200818 yr Hey, my first question is where is the JavaScript forum/section on this board ? And my problem is I want a real time function in JavaScript to put on my site. I had a PHP clock before but you have to refresh it to see that the time changes, I'd like to make a clock wit js that changes every second, you see what I mean ? Any idea how to do that ? thanks. Revs . Edit : whoops found a topic about that, works now. Sorry for creating a new topic, did not find any delete button …
July 20, 200818 yr Hey, my first question is where is the JavaScript forum/section on this board ? And my problem is I want a real time function in JavaScript to put on my site. I had a PHP clock before but you have to refresh it to see that the time changes, I'd like to make a clock wit js that changes every second, you see what I mean ? Any idea how to do that ? thanks. Revs . Hi i am no expert but i have a simular problem refreshing a page on a chat room i made i at to use ajax periodic updater script i havent got arround to doing it yet but here is the code i was given <script type="text/javascript"> function ajaxread() { var ajaxread; try { ajaxread=new XMLHttpRequest(); } catch (e) { try { ajaxread=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajaxread=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { document.write("This page needs AJAX to run"); return false; } } } ajaxread.onreadystatechange=function() { if(ajaxread.readyState==4) { document.getElementById("chat").innerHTML=ajaxread.responseText; } } ajaxread.open("GET","read.php",true); ajaxread.send(null); } function readalways() { setTimeout("ajaxread()",2500); setTimeout("readalways()",2500); } readalways(); </script> <div id="name of div">text goes here </div> hope it helps
July 20, 200818 yr Author Everything that appears is the text goes here in the DIV, I don't see the time :/. But thanks.
Create an account or sign in to comment