ID:1980639
 
(See the best response by NullQuery.)
I'm working with browser windows in BYOND and they display a lot of information, thus sometimes requiring scroll bars. When a user clicks something, it of course sends the info back to BYOND and the page gets updated ("refreshed"). That part is easy enough.

What I'd like to then do would be to have the browser return to where the user was looking before the refresh happened. This is possible in real html using anchors, but the BYOND browser doesn't work like that.

e.g.
<a href="http://mysite.compagejump.html#someanchorname">

<a name="someanchorname">Appear here</a>


So how do I make a browser scroll to a specific point on load? Is it even possible?
Best response
You can accomplish this very easily by using JavaScript and setting document.body.scrollTop when the page is loaded. However, I'd advise against that because the player is still going to see a noticeable "flicker" effect when the page is refreshed.

My advice is to dynamically update your page. This is also done with JavaScript. To do this you'll have to use the output() proc to call a JavaScript function from which you can then update the page.

You may want to look at the html_interface module I wrote for SS13. It's plug & play so you should be able to copy the "modules\html_interface" folder to your own project and include the files. From there you can use the API (see html_interface.dm for details) to dynamically update a browser window without a full refresh.

I'm sorry I can't help further at this time, but I hope I have at least pointed you in the right direction. If you have any questions feel free to ask and I'll look at it once I get back from work.
Well it certainly sounds like something to try, so I'll give it a shot! Thanks.