473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

automatically scrolling down the page to the bottom after adding data to it by xmlhttpreq object?

Hi guys,
I have some problem about my little http/javascript/xmlhttpreq based
chatroom program:
I use xmlhttpreq object to add data to the current html file.
It will add to a specifiy place, like after a tag or before a tag
And if it adds too many data after that tag, the whole page will become
big and need to scroll down to see the latest added data
how to let it scroll down automatically without any annoying scrolling
down?

One way I can use is to use a anchor which is at the bottom of that
page and after i put my data into the textbox and click the link( which
is linked to proper file to process the data but also point to the
anchor) the page will show from the bottom. but the whole page will
first jump up a little space then jump down. It's annoying too :(

Any1 has idea?

Deryk

Nov 9 '05 #1
1 1858
zh******@gmail.com wrote:
Hi guys,
I have some problem about my little http/javascript/xmlhttpreq based
chatroom program:
I use xmlhttpreq object to add data to the current html file.
It will add to a specifiy place, like after a tag or before a tag
And if it adds too many data after that tag, the whole page will become
big and need to scroll down to see the latest added data
how to let it scroll down automatically without any annoying scrolling
down?

One way I can use is to use a anchor which is at the bottom of that
page and after i put my data into the textbox and click the link( which
is linked to proper file to process the data but also point to the
anchor) the page will show from the bottom. but the whole page will
first jump up a little space then jump down. It's annoying too :(

Any1 has idea?


Without seeing your code, only guesses are possible.

You might try window.scrollBy() with suitable values - either calculated
or just some silly number for the y value like (0, 10000):

<URL:http://www.mozilla.org/docs/dom/domref/dom_window_ref106.html>

<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/scrollby.asp>
--
Rob
Nov 9 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott M | last post by:
Hi, I am writing a small game that is using a form 800 * 600. The form can be scrolled vertically up to a height of 1200 (basically the form can be scrolled down one screen vertically). The...
4
by: headware | last post by:
I have a <select> control that contains many entries. It allows the user to multi-select a group of them, click a button, and store the selected data in a database. Normally they do this starting...
2
by: James CC | last post by:
I have a strange bug in C# using windows forms. To make sure it's not some bug with my code, I've gone back to a simple test app, and still see the same behavior. I have created a simple C#...
6
by: paul reed | last post by:
Hello, I have two environments, QA and Production. When the users are testing, I want them to know they are in the QA environment versus the Production enviroment. One solution would be to use...
7
by: Shawn B. | last post by:
Greetings, I am trying to create a table that has a scrolling body. The problem I'm experiencing is that if the columns in the "body" part of the table exceed the width of the "header" then...
0
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
2
by: Sugapablo | last post by:
I have a layer, which is a DIV that has overflow set to "auto", so it looks like a little pop-up window, even though it's just a layer. So if the content of that window makes the user scroll down...
2
by: gunnuk | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.