http://qs321.pair.com?node_id=604779


in reply to POST and automatic redirecting?

I've always thought voting would be the ideal candidate for AJAX (not every use of AJAX is Evil, believe it or not). From a purely UI point of view, it's a pain to have to scroll to the bottom of the page to click the 'Vote' button, especially if there are a lot of replies.

But even without that, it's becoming a standard to redirect after a POST, rather than having the POST action display content.

Replies are listed 'Best First'.
Re^2: POST and automatic redirecting?
by chargrill (Parson) on Mar 14, 2007 at 15:44 UTC

    I've always thought voting would be the ideal candidate for AJAX

    Actually, I disagree. Sometimes I find myself clicking the up- (or down-) vote buttons, but then (before reaching the "vote" button) change my mind and either completely reverse my vote, or remove my vote from a given node (+=0). If clicking a vote button auto-fired an AJAX request, I'd have no chance for take-backs.

    Could it be a user training issue? Maybe. But I don't think I'll change my behavior.



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
      Actually, I disagree. Sometimes I find myself clicking the up- (or down-) vote buttons, but then (before reaching the "vote" button) change my mind and either completely reverse my vote, or remove my vote from a given node (+=0). If clicking a vote button auto-fired an AJAX request, I'd have no chance for take-backs.

      Well, I guess that if hypothetically AJAX voting were implemented, it would be a personal choice, whether to activate it or not, just with quite about so many PM features.

      There are a few options to solve that, one of the simplist of which is to have a button next to each set of radio buttons to actually submit the vote. (The button could be optional).
Re^2: POST and automatic redirecting?
by iguanodon (Priest) on Mar 14, 2007 at 16:15 UTC
    it's a pain to have to scroll to the bottom of the page to click the 'Vote' button, especially if there are a lot of replies
    You can use CSS to float the vote button so there's no need to scroll. See Re: The big Vote button.

Re^2: POST and automatic redirecting?
by radiantmatrix (Parson) on Mar 14, 2007 at 16:17 UTC

    From a purely UI point of view, it's a pain to have to scroll to the bottom of the page to click the 'Vote' button, especially if there are a lot of replies.

    So... don't. The voting buttons are one large form on each page. In Firefox, at least, clicking a voting radio button and pressing Enter submits the form. Even without that, though, I've never found pressing Ctrl-End in order to get to the bottom of the current page to be "a pain".

    <radiant.matrix>
    Ramblings and references
    The Code that can be seen is not the true Code
    I haven't found a problem yet that can't be solved by a well-placed trebuchet
Re^2: POST and automatic redirecting?
by talexb (Chancellor) on Mar 15, 2007 at 14:56 UTC
      From a purely UI point of view, it's a pain to have to scroll to the bottom of the page to click the 'Vote' button, especially if there are a lot of replies.

    Then you may not be aware that pressing Enter does the same thing as clicking on the Vote button. I do that all the time .. the alternative would be End, followed by a mouse click. Still not that bad.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      I am aware about using 'Enter', but then I have to wait for the page to reload. And depending on your browser (and potentially some other things), the page may not be reloaded at exactly the same place you were before you pressed 'Enter', so you lose your place (can be a problem if the thread is really long). Same problem if you go to the end of the page and click the button.

      Minor annoyances, yes, but I think there's a fairly simple solution.

      UI can often be a matter of opinion or personal taste, but surely it makes sense to allow a user to make a decision on voting for a particular reply while they're viewing it, and not have to scroll to find where they were?

      (Actually, the scrolling issue could be fixed if the page redirected correctly, and anchors were used, but I'd still like to at least see a button next to the voting radio buttons).
Re^2: POST and automatic redirecting?
by blazar (Canon) on Mar 14, 2007 at 22:06 UTC
    not every use of AJAX is Evil, believe it or not

    I never thought so. The issue has been discussed before. And the general consensus is that there are good reasons not to do so. You may want to use Super Search to find relevant threads. OTOH bsdz posted a solution that may be enough for you.

      Perhaps AJAX is not the answer then, but there are some other options (some of which I mentioned in my post below). I guess this is not really a priority for the dev team, and I'm not trying to demand that they fix it. It's just one of those things I look at whenever I visit the site and think "there must be a better way" :)