?
Solved

Can I force the browser to scroll to the bottom of a page?

Posted on 2006-04-03
11
Medium Priority
?
780 Views
Last Modified: 2010-08-05
Heloo.

I would like to bookmark a page such that the browser automatically scrolls to the bottom of it after loading.  The trick is that I do not control the page I am bookmarking -- I simply visit it each day, scroll to the bottom, read a few things, then close the page.

I want to bookmark the page, similar to www.blahblah.com#bottom.  Of course, as stated, there is no named anchor "bottom" and I cannot add one, since I am not the author of the page.

As a valid example, I would like to bookmark page http://www.jetbrains.com/idea , but have the browser automatically scroll to the bottom after loading.

Thank you.
0
Comment
Question by:ForceRs
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 16365940
I don't believe this is possible...

I may be wrong though...but I think you may fall foul of cross site scripting security issues...

Tim
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 16366029
What you need is an anchor <a name="bottom"> at the end of your code(Page).  Then <body onload="self.location.hash='bottom'>.
This should work for all browsers.
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 16366034
sorry i misread the post, disregard my Comment.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 11

Expert Comment

by:mvan01
ID: 16366069
When you open a page without the filename, you're most likely opening index.htm or index.html.  In your example above, you're opening:

http://www.jetbrains.com/idea/index.html

(found by trial and error)  Usually you can find the filename exactly by navigating around the site, clicking on a 'home' link, etc.

Next, you need an anchor.  As you said, you can't 'write' one, but you can look to see if one exists.  With the page loaded, from the browser menu (or right-click menu) choose view source.  Scroll to the bottom of the source.  Look for a span or div with an id= statement.  In your example page above, I found:

<div id="footer">

Now, just add that to your url, your intuition was right:
http://www.jetbrains.com/idea/index.html#footer

Granted, it only works if such a construct already exists in your favorite page.  Happily, in many, it does!

Peace and joy.  mvan
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16367942
What you ask for is called bookmarklet.
But it cannot work the wey you ask because of this words: "...after loading."
After window loading is your window script stack cleared.
This will NOT work:
javascript:void(location.href='http://www.jetbrains.com/idea');void(setTimeout('scrollTo(0,90000)',3000))




0
 
LVL 3

Author Comment

by:ForceRs
ID: 16370647
mvan01, thanks -- very close, but the page I want to bookmark does not contain an appropriate <div>.

Here is a better sample page: http://bugzilla.ximian.com/buglist.cgi?product=Evolution&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&target_milestone=2.1&priority=Normal
0
 
LVL 11

Accepted Solution

by:
mvan01 earned 2000 total points
ID: 16373259
Hi ForceRs,

Given your example, I find there's a

name=buglist

and

name=id

in the final constructs of the page.  Either of those worked for me, as in:

http://bugzilla.ximian.com/buglist.cgi?product=Evolution&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&target_milestone=2.1&priority=Normal#buglist

I think this is the best we can do.  If an id= or a name= , you can attach that label to your url with a pound sign, and it will scroll to there.  If you find one near the end of the page, it will open at that location, near the end of the page.

Peace and joy.  mvan
0
 
LVL 3

Author Comment

by:ForceRs
ID: 16373815
Thank you.  This works great in Internet Explorer, but does not in Firefox.  I know that fireFox is super picky about these things, so this is as good as it gets.  

Thank you again!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16373841
You are welcome.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16373844
Uhps :)
0
 
LVL 11

Expert Comment

by:mvan01
ID: 16374825
You are welcome, too. :-)  Peace and joy.  mvan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question