This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
View Entire Thread
Re: Focus to top of page

To start, you have a small error in your "body" tag. It is missing the terminating right arrow. It doesn't seem to bother anything, but it should be fixed.

When Bravenet's Embedded Photo Album starts, it does try to change the "top of page". It adds a link target on the end of your web page URL. But I looked at your page in IE and Firefox. IE didn't have any problems. The top of page was always correct. Only Firefox had a problem.

So then I started to look for the real issue. When I am troubleshooting a page, I initially remove anything that is not relevant to the page displaying. So I started by removing your counter and the Google ads. The debugger didn't show any real issues. Just a bunch of complaints about style definitions. Your "style.css" and "print.css" have a bunch of declarations that are not acceptable or just incorrect. But those are OK too. Bravenet's code has a lot if issues also. But overall, no real scripting errors.

Then I noticed the small bit of Javascript embedded about 350 lines from the top. There I see another "onload" function. So you have a "onload" operation in the "body" tag and a function assigned to the "window[dot]onload" operation embedded in the HTML code. This kind of thing is not recommended, because one operation may override the other. It can be inconsistent between browsers. The actual recommendation is to take the operations required from the "window[dot]onload" function and put it in the "body" "onload" operation. This eliminates any conflicts that might exist.

But, I didn't want to make any sweeping changes to the web page, and my dogs needed to be fed, so I just added an extra command to the "window[dot]onload" function definition. The code is listed below. I highlighted the added command.

Code:
window.onload = function() {
hidebar();
if (window.sizeLines) sizeLines();
<span style="font-weight:bold;">setTimeout('self.scrollTo(0,0)',30);</span>
}


The code sets a timeout of 30 milliseconds, before it executes the command. This makes the display flash quickly, but it's hardly noticeable. To see it work, increase the delay to 2000 milliseconds. The page will act normally and then scroll to the top after 2 seconds. While 30 milliseconds worked for me, you may have to play with it a bit and extend it a little longer, to account for network delays.

Browser: Firefox, Netscape, Sea Monkey, Internet Explorer, .....

OS: Solaris (Sparc,x86), Linux, XP

Re: Focus to top of page

You little beauty!! That works an absolute treat. Thank you so much for taking the time to have a look at my page and suggest a solution. Very much appreciated.
And yes, I have started to fix the errors you have mentioned as well.
Once again.... thanks!!