For example in some cases after POST or GET request I want to redirect user not only to specific page, but to a specific part of page. What would be better: implement this in Django(reconstruct redirect url?) or implement this in javascript?
Asked
Active
Viewed 1,828 times
3
-
1"to a specific part of page" Are you referring to an anchor? – Andrew Sledge Jun 15 '12 at 15:27
-
It's correct, I am talking about anchor – sunprophit Jun 15 '12 at 17:08
1 Answers
6
Why would you want to do it in JS? If you're redirecting to a different page already, just add #whatever
to the redirect URL to go direct to the anchor.

Daniel Roseman
- 588,541
- 66
- 880
- 895
-
-
3Django's reverse() function will return a unicode string, so you can just do: reverse('my_vew_name') + '#whatever" – Nuno Maltez Jun 15 '12 at 17:17