Click to See Complete Forum and Search --> : Tricky javascript command


demose01
11-06-2003, 09:39 AM
Thanks in advance first thing.

I'm trying to write a simple chatroom application for my website. I've looked around at some of the free ones on the net and I haven't been satisfied.

What I've written so far works fine and by using remote execution, I can detect when a new post is made to the chatroom(thus cutting down how many refreshes I have to make). The problem is that I don't want to have to refresh it at all. So I used a remote execution function to return the contents of the chatroom back to be displayed, but when I change the innerHTML of the <p id=textToChange></p>, I end up getting all the HTML code as text.

My question is, can I use the innerHTML to change the contents of textToChange but have the browser recompile the HTML code without having to refresh? Or, is there a better way all together to do this? The end result I want is that the contents of the chatroom are altered, allowing for html code, without having to refresh the page.

Khalid Ali
11-06-2003, 10:07 AM
am not sure if I understood you completely,however,when you use innerHTML, browser changes the contents on the fly and does not refresh the whole page,but only the element for which you are changing the contents

demose01
11-06-2003, 08:08 PM
"browser changes the contents on the fly "

thats the point. I don't like the refresh because it makes the page jump. I want to alter the page contents on the fly, which I've already managed to do with the innerHTML. The problem is that using that and html tags don't mix, so the html goes in but is not compiled.