Howdy,
I am looking for a simple way to have live data displayed in a window that has scroll bars. I am building a simple (well, it started simple) chat example using AJAX and want to display the history in a scrolling window.
Is FCKeditor the way to go? I'm using it for the edit buffer and got to wondering...
Is there an example that would give me some idea what to do?
Thanks,
Gary
I am looking for a simple way to have live data displayed in a window that has scroll bars. I am building a simple (well, it started simple) chat example using AJAX and want to display the history in a scrolling window.
Is FCKeditor the way to go? I'm using it for the edit buffer and got to wondering...
Is there an example that would give me some idea what to do?
Thanks,
Gary
RE: using with live data
okay.. For read only data there really is no point in using the editor
so for read-only display of formatted text:
create a div, give it a name
set whatever positioning style you like, but also add overflow:auto; as one of the css style options for your div
(this makes scrollbars when appropriate within the div)
Then, I'm sure you know how to populate the layer, but here's a snippet anyways:
assukming the div is in the current document and is named "oDisplayDiv".. also assuming that oldest text is at the top, and newest at the bottom.
get the layer:
NS4) var oMyLayer = document.layers["oDisplayDiv"];
IE) var oMyLayer = document.all["oDisplayDiv"];
all other DOM compliant browsers (such as mozilla)
var oMyLayer = document.getElementById("oDisplayDiv");
Update the layer's content (sNewLine being the new line of formatted text):
oMyLayer.innerHTML = oLayer.innerHTML + sNewLine
RE: using with live data
Thanks. (nice clean example!)

I was thinking that using FCKeditor would give me a way to set the cursor and to scroll the window with JavaScript.
Can I scroll the window with FCKeditor and JavaScript or am I making that overly complicated also
Gary