Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Simple problem with a simple chat script

Reply
Thread Tools

Simple problem with a simple chat script

 
 
dillon
Guest
Posts: n/a
 
      11-10-2003
Hi everyone

I'm writing a javascript/php chat script, but I've run into a problem
that is probably very, very simple to fix but I don't have a clue.

The problem is with an iframe (should I be using an iframe in the first
place?) that shows all the chat so far - all I want to do is get the view to
scroll to the bottom of that iframe when it first loads or refreshes.
That's the entire problem in a nutshell! Lines of text are added to the
bottom of the file shown in the iframe, but when the number of lines exceeds
the height of the iframe the vertical scrollbar appears (which is desirable)
but the new conversation is hidden off the bottom.

The reason for the iframe btw is that I couldn't find a compatible way
of updating part of a page without using form elements, and I want to use
things like different font colours for different users in the chat pane,
which I can't with form elements.

Any tips or a possible fix for this would be greatly appreciated, and
particularly cross-browser working example code

This has got a lot longer than I expected, I'd better go to bed now,

Cheers in advance to anyone who can help

dillon


 
Reply With Quote
 
 
 
 
higabe
Guest
Posts: n/a
 
      11-17-2003
I don't really have any exprience at this but since nobody else has
answered. Why don't you try:

window.scroll(0,99999999);

I don't know if it's cross-browser compatible or what but it's a start.

dillon wrote:
>
> Hi everyone
>
> I'm writing a javascript/php chat script, but I've run into a problem
> that is probably very, very simple to fix but I don't have a clue.
>
> The problem is with an iframe (should I be using an iframe in the first
> place?) that shows all the chat so far - all I want to do is get the view to
> scroll to the bottom of that iframe when it first loads or refreshes.
> That's the entire problem in a nutshell! Lines of text are added to the
> bottom of the file shown in the iframe, but when the number of lines exceeds
> the height of the iframe the vertical scrollbar appears (which is desirable)
> but the new conversation is hidden off the bottom.
>
> The reason for the iframe btw is that I couldn't find a compatible way
> of updating part of a page without using form elements, and I want to use
> things like different font colours for different users in the chat pane,
> which I can't with form elements.
>
> Any tips or a possible fix for this would be greatly appreciated, and
> particularly cross-browser working example code
>
> This has got a lot longer than I expected, I'd better go to bed now,
>
> Cheers in advance to anyone who can help
>
> dillon

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple chat script Clayton23 Javascript 1 06-12-2008 08:36 PM
simple chat script Dave Kelly HTML 4 02-19-2007 12:08 PM
Chat Server and Chat Client for INTRANET diptanu@gmail.com Java 0 01-30-2006 06:56 PM
simple RMI chat problem Angus Parvis Java 1 05-17-2005 11:29 AM
Very simple chat - problem with message sending Ali Java 0 02-21-2004 07:58 PM



Advertisments