473,324 Members | 2,002 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,324 software developers and data experts.

Reload without moving to the top of the page

Hi folks,

Does somebody know how to reload a page without moving to the top of the
page ?

I have tried the two following commands :
1) window.location=document.location;
2) location.reload();
but, each time, the scrollbar is moved to the top of the page.

Thanks a lot for your help
M@rtin

Jul 20 '05 #1
3 7345
Perhaps with the reload function, you can add window.scrollBy(x,y) or
scrollTo(x,y) to put the user back where they were??
(you could even use a mouse-coordinates detection script to get the exact
location of their 'click' that makes the page reload).

Hope that helps!

Jim
Jul 20 '05 #2
Thanks a lot Jim,

I use it with "window.pageYOffset" or "document.body.scrollTop" (according to
the browser) to store the current scroll position ... and it works well !

Have a good day
Martin

-------------
JimMenees a écrit :
Perhaps with the reload function, you can add window.scrollBy(x,y) or
scrollTo(x,y) to put the user back where they were??
(you could even use a mouse-coordinates detection script to get the exact
location of their 'click' that makes the page reload).

Hope that helps!

Jim


Jul 20 '05 #3
"Martin RAYROLE" wrote on 12/11/2003:
Thanks a lot Jim,

I use it with "window.pageYOffset" or "document.body.scrollTop" (according to the browser) to store the current scroll position ... and it works well !
Have a good day
Martin

-------------
JimMenees a écrit :
Perhaps with the reload function, you can add window.scrollBy(x,y) or scrollTo(x,y) to put the user back where they were??
(you could even use a mouse-coordinates detection script to get the exact location of their 'click' that makes the page reload).

Hope that helps!

Jim


What browser(s) have you tested this with? The window.page?Offset
properties return 'undefined' in IE 6.

Mike

--
Michael Winter
M.Winter@[no-spam]blueyonder.co.uk (remove [no-spam] to reply)
Jul 20 '05 #4

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

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
1
by: Cooper | last post by:
Hello, is possible to disable the reload (or update, for ie) of the a web page? If yes, what i do? Otherwise if isn't possible, what i do for to set the default value of a form when a user do a...
1
by: Marshall Dudley | last post by:
I need to be able to allow a user to submit a form which opens another window. This part I have working. But after the submit, I need to delay and have the original window do a reload. I cannot...
3
by: Kurita Kinoshita | last post by:
I'm trying to find a way to have a script communicate with a server without having to load a new page. The idea is to have the server act as a simple wrapper for a database, letting the client do...
4
by: N. Demos | last post by:
Hello, I'm learning ASP.NET, and am having a strange problem with some example code from the book I'm using. The code increments and displays the value stored in a session variable when the "Add"...
3
by: michael | last post by:
Good Morning Everyone, I am writing a script to add and remove rows from a table. Here are the two functions: function newRow(rowNo) { var theTable = document.getElementById("table1");...
3
by: ghostwolf | last post by:
Hi, I'm new to ASP.NET. If the web page is running in server-side, how can I reload the particular section of the web page instead of the whole page? Say, I've separated the web page into several...
16
by: sreemati | last post by:
Hi everyone, This is the scenario: I have two button - Submit and Reset Submit is used for validation and after validation is passed it passes it to another form to enter into database. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.