views:

12

answers:

1

Hi is there way to actually link to any site (not your own). And when clicked it takes you to that site + x amount of code.

Of course I am not talking about the pages which all ready have a jQuery plugin or something, I am talking include the paramater of "scroll" (or what ever) already from my site or link.

I guess the answer could be that there isn´t any way but I hope there is a way to "tell the browser" follow that and then scroll this much...

I hope the question is clear enough, if not please ask for any clarifications needed!

Thanks in advance!

Trufa

+1  A: 

No, there's no way to control the browser scrolling through the window generically via a URL unless the web page itself supports it.

The most common way to support it is the anchor tags, to which you can the link directly in the form of http://your-server/your/url.html#tag_name. The HTML page in question would then define the scroll point by declarintg the anchor via <A name="tag_name">.

As per robertc's comment, modern browsers also support using element IDs as tag names in this manner - but again, you need the target HTML document to have an element with an ID placed in the desired scroll point. It works on my FireFox 3.6.10 - to test on your browser, go to http://stackoverflow.com/questions/3980823/link-to-site-with-scroll-included/3980905#answers and see if it scrolls down to the start of the answers.

You could also approach this by building a browser extension (e.g. FireFox Add-On) which would allow scrolling down upon a link for any web page, but this would then only work for users who have that specific browser with that specific extension installed.

DVK
It'll also work (in modern browsers) with ids. If you can find an element with an id near to where you want to link to, then just put the id after the #
robertc
Thanks DVK i thought so!
Trufa
@robertc, do you whant whant to make an answer with that comment? that is a great workaround!
Trufa
@Trufa DVK has updated his answer with the relevant info, not much point duplicating it :)
robertc
@DVK thank you very much that is great!! youve been of much help! The #id is a very suitable workaround!
Trufa