0

I found out two solutions: Php/html: header('Location: website.php#formDiv'); and jQuery

Php/html option is simple and i really like it... but it makes my url ugly: [https://website#formDiv].

Is any solution to hide it? or i have to use jQuery?

  • 2
    URL fragments are a standard and widely used feature. Their 'ugliness' is subjective, but they are very useful. You could use JS for it instead, but it's a lot of code for very little benefit. – Rory McCrossan Sep 02 '21 at 09:25
  • If you want to use JS/JQuery, refer to this answer: [How to retain scroll position after reloading the web-page too?](https://stackoverflow.com/questions/40035436/how-to-retain-scroll-position-after-reloading-the-web-page-too). Using session storage to save scroll position when page is reloaded. – NcXNaV Sep 02 '21 at 09:26
  • 1
    "You could use JS for it instead, but it's a lot of code for very little benefit" - exactly :( – folmijurka Sep 02 '21 at 09:27

0 Answers0