Click to See Complete Forum and Search --> : location.hash in IE reloads doc
I'm writing page that presents series of long text passages each followed by rating scales consisting of buttons. As part of the form verification process, I'm trying to use location.hash to navigate to passages that the users have not rated, but I'd like the passage to appear at the top of the screen with the rating buttons below it. Seems like has navigation fits the situation. Unfortunatlely, somtimes (inconsistently) the browser reloads the entire doc, erasing all of the button clicks already there (can be hundreds). According to Goodman's JavaScript Bible (p 489) "such navagation [location.hash], even within a document, sometimes causes IE to reload the document." Q1: Is there anything I can do to fix this? The only alternative I know, focus(), puts the buttons at the very top of the screen, where the text passages users are supposed to be rating are not visible (unless they scroll up to see them). Q2: Is there an alternative way of navigating to a point above my buttons, so the passages can be seen with the buttons below? I don't know whether it is possible to use focus() to go to a hidden item, but I'd prefer not to do that for other reasons.
Sorry about the long question. I'm pretty much a novice at Javascirpt, so please if you have a suggestion, be as clear and complete as you can find time to be.
Best wishes,
khalidali63
05-07-2003, 08:03 AM
It sounds like there may be another way of getting this done,do you hae a link to the page in question available,so that your question can be seen with relationship to the questions
AdamGundry
05-07-2003, 10:56 AM
You might be able to use window.scrollTo() (http://developer.netscape.com/docs/manuals/communicator/jsref/win1.htm#1188248)?
Adam
Thanks for your quick reply, and my apologies for getting back so late. It took me a while to set up the pages on my office server, but they are now there.
The URL of the "start" page that will eventually get you to the problem page is http://140.146.120.125/research/GJokesDE1/ConsentGJokesDE1.htm
The problem page is http://140.146.120.125/research/GJokesDE1/GJokesDE1.htm; I've attached the whole page to this reply.
The earlier pages pick up information that is passed to the GJokesDE1.htm problem page as URL decorations. To save time and avoid filling out these preliminary pages for testing purpose, I set up the GJokesDE1.htm page to fill in some dummy information so that you really don't have to come from earlier pages. This doesn't seem to affect the problem, but I'm too much an amateur to know.
To get the error on the GJokesDE1.htm page, click on a few buttons, then Submit the form. However, the problem is intermittent; it seems to happen most often when I come to the site "fresh" after a day off; once the page has been successful it seems to be OK after that.
On the GJokesDE1.htm problem page the form validation section is at lines 183 - 204. The code that inserts the hashes is at lines 282-333.
Thanks for any suggestions you might have.
Sorry, I forgot to include the GJokesDE1.htm file on my reply. Here it is.
Also, I think the URL of the problem page in my earlier post is incorrect: it should be
http://140.146.120.125/research/GJokesDE1/GJokesDE1.htm
Again, thanks,