Skip to main content

Posts

Showing posts from June, 2020

Button to reload the page and go to a section with a hash mark

While there are lots of ways to code it so a button reloads the page, it was hard to figure out how to do it in such a way that it goes automatically to a URL with a hash. So here is my solution that works, finally. Update - better solution: Here is a better solution, since the one below worked for me on any page except the domain root. It may be the way my CMS is set up or it may be the way my server is set up, or most likely I'm missing something fundamental about the way the function works. Anyway, the better solution I've gone with doesn't include the hash in the URL, but it reloads to the point the user was last browsing at, which for my purposes worked out the same as the hash. So here is the solution I'm going with for now. <button onClick="window.location.reload();">Generate New</button> The solution I put earlier (see below) did not work for me in all instances, but it's worth trying out. The initial problem I needed a button that user

About Me

My photo
Vera
I'm a wife and mother. I don't have any formal computer science qualifications, or any religious qualifications. I have a PhD in biochemistry. This photo is of me, but is confusing for AI.