Okay, here's the problem. I have a small part of my page that displays the number of users on my forums by using a small Javascript code. This is:
<script src="../bbs/cgi-bin/yabb/YaBB.cgi?action=printwhoisonline&group=guests></script>
Currently I've put this on a separate frame, using META refresh to refresh it every few seconds. Problem is, that looks ugly - I only want the text to refresh not the whole frame. So I came up with this based on another code I saw:
There are
<script>
function refresh() {
document.write("<script src="../bbs/cgi-bin/yabb/YaBB.cgi?action=printwhoisonline&group=guests"></script>"
;
window.setTimeout("refresh();", 100);
}
window.onload = refresh;
</SCRIPT>
other users online.</td>
Unfortunatley, it doesn't like the <script> tags nested inside the document.write, and it treats the </script> inside the document.write as if it was closing the refresh script as well as the one I want.
Any ideas as to how I can fix this? Or another way of getting a script to refresh every few seconds?
Any help much appreciated,
Moon Shadow
Official Javascript Newbie
moonshadow@talk21.com
<script src="../bbs/cgi-bin/yabb/YaBB.cgi?action=printwhoisonline&group=guests></script>
Currently I've put this on a separate frame, using META refresh to refresh it every few seconds. Problem is, that looks ugly - I only want the text to refresh not the whole frame. So I came up with this based on another code I saw:
There are
<script>
function refresh() {
document.write("<script src="../bbs/cgi-bin/yabb/YaBB.cgi?action=printwhoisonline&group=guests"></script>"
window.setTimeout("refresh();", 100);
}
window.onload = refresh;
</SCRIPT>
other users online.</td>
Unfortunatley, it doesn't like the <script> tags nested inside the document.write, and it treats the </script> inside the document.write as if it was closing the refresh script as well as the one I want.
Any ideas as to how I can fix this? Or another way of getting a script to refresh every few seconds?
Any help much appreciated,
Moon Shadow
Official Javascript Newbie
moonshadow@talk21.com