1

I'm using http://simplemvcframework.com and I want to link to a section on a page normally you will just add something link

#section4 

to the end of the URL but this doesn't work as expected, it doesn't jump to the correct section of the page. I'm suing the following format to try and achieve this:

/controller#section4

Do I need to pass the view into the link somehow? possibly something along the lines of

/controller/viewname.php#section4
twigg
  • 3,753
  • 13
  • 54
  • 96

1 Answers1

1

I have never used that framework before, but anchors are handled by the browser, and don't even get sent to the browser.
(I.e. when accessing /controller/#section4, the server only receives /controller/.)

It looks like you don't know about the actual use of # in URLs:
Upon loading the page, the browser will look for an element on that page with an id or name (for backwards compatibility) matching the part after the #.
So you probably just want an element with id="section4" on that page.
If you need HTML 4 support, you have to put <a name="section4">...</a> around your anchor to achieve the same effect.
(See also this question.)

Community
  • 1
  • 1
Siguza
  • 21,155
  • 6
  • 52
  • 89