Codeigniter - open a page and jump to anchor point.


I'm building my first app in Codeigniter; liking it...

I have one page updating some user data, and then going back to a summary screen.  All good.

Now once the update has happened, I want the controller to load the summary page, but also jump to a specific anchor on the view.

So the question: how do I display a specific anchor point in a view using the controller?

Who is Participating?
CrisThompsonUKConnect With a Mentor Author Commented:
woops, forgot to close this question.

I didn;t get this working on a normal CI view display, but I did get it onto a refresh:

redirect("/managecards#$thisServiceID", 'refresh');

Open in new window

Ray PaseurCommented:
This is not CodeIgniter specific, it's just HTML.  If you have a URL with a hashtag at the end you can use the HTML anchor tag to cause the jump.

I've never used this in HTML5 and W3Schools seems to believe that it is unsupported.  They recommend using the id attribute instead.

You might find that the id attribute in combination with jQuery "Scroll" would be a good way to go.  The "id" must be unique so it can be used as a jQuery selector.

HTH, ~Ray
CrisThompsonUKAuthor Commented:
no other Codeigniter specific response.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.