freelance84 Posted July 7, 2010 Share Posted July 7, 2010 I've noticed on this and a few other websites a nifty little trick... When scrolling down a page and I find a thread i'm interested in, I click on it. It then takes me to this thread. When I press back from this thread, the page has already scrolled down the list to where the thread link was. How is this down? I've disable all cookies and javascript whilst on phpFreaks but it still works! Is it something to do with page anchors? Quote Link to comment https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/ Share on other sites More sharing options...
Adam Posted July 7, 2010 Share Posted July 7, 2010 It's just a browser feature, there's nothing in-place on the website to control that. Quote Link to comment https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/#findComment-1082541 Share on other sites More sharing options...
freelance84 Posted July 7, 2010 Author Share Posted July 7, 2010 oh Well then I have a question... There is a section on my site which contains a list of names (these can be anything from people to fictional characters), next to each name is two buttons, "edit" and "delete". When a user presses delete it reloads the script and the name which is to be deleted... The buttons now read "edit" and "deleting" (the deleting button also changes type from submit to button). Under this there is a "Are you sure you wish to delete? Yes No". The problem is, this list can be 50 long and when the page reloads the user then has to scroll down to find the "Are you suer you want to delete" question. Is there anything else I can send with the original "delete" button which would mean the page jump automatically without the user having to scroll? Sort of like an internal link, only different Quote Link to comment https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/#findComment-1082551 Share on other sites More sharing options...
phpology Posted July 7, 2010 Share Posted July 7, 2010 try using a hashtag i.e. <a name="r-u-sure"></a> and place that clsoe to your confirmation area When you repload your page add in #r-u-sure at the end of your url like this: repload.php#r-u-sure. Why dont you use javascript confirm() to ask for confirmation when deleting? Quote Link to comment https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/#findComment-1082555 Share on other sites More sharing options...
freelance84 Posted July 7, 2010 Author Share Posted July 7, 2010 That's brilliant! It worked perfectly! Trying to get the site working completely first without javascript. After which I intend to start to include javascript. Also I only started learning php html mysql css in March so I really want to get a solid grip on those first before learning Javascript. Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/207026-remembering-positions-in-a-list/#findComment-1082575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.