> Does anyone else have ideas of how to do something like this? Thanks!
maybe urlencode()'ing the '/page#section1' parameter?
--
Javier
but where is it getting lost? i mean, what does the html looks like?
does it have the #section1 in the action attribute? i imagine three
answers:
1: no #section1 in the HTML => Django is losing it, should be fixed
2: #section1 present, but not urlencoded => Django should encode it,
since it's a parameter for the view wrapper.
3: #section1 present and urlencoded => browser's fault, should be
worked around with JavaScript
--
Javier
Re-read the thread. The #part of the URL is not something ever
transmitted beyond the browser. No web application ever sees the #part
of a URI.
>
> 2: #section1 present, but not urlencoded => Django should encode it,
> since it's a parameter for the view wrapper.
>
> 3: #section1 present and urlencoded => browser's fault, should be
> worked around with JavaScript
>
Cheers
Tom
as i understand it, the #part doesn't get _back_ to the server; but is
it getting to the browser in the first place? not in the 'current
url', but in the 'action' attribute of the form, (or 'href' of a
link?)
--
Javier
The only way I know around this involves leaning on JavaScript to
get the URL, split off the #hash bit from it, and sneak it in as
a hidden element on the login form. It breaks for those of us
that use the Firefox NoScript plugin or browse from a
non-JS-enabled browser (such as Lynx or Dillo which I use
regularly) but it merely provides a convenience the user is
opting to forgo.
So if you execute something like
function snag_loc() {
var loc = window.location.href;
var bits = loc.split('#');
var fragment = "";
if (bits.length > 1) {
fragment = bits[1];
}
document.forms['myloginform'
].elements['hidden_fragment_input'
].value = fragment;
}
on loading, it will set the value of your "hidden_fragment_input"
field to the fragment it found in the URL, which will then make
it available to the login POST.
-tim