Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: AJAX replacement for voting buttons

by bsdz (Friar)
on Jan 03, 2007 at 09:29 UTC ( #592722=note: print w/replies, xml ) Need Help??


in reply to Re: AJAX replacement for voting buttons
in thread AJAX replacement for voting buttons

  • You can add http://perlmonks.org/* to your "Included pages" when you "Manage User Scripts..." in GreaseMonkey.
  • Subjective. I feel they are more user friendly as they are single-click.
  • I'll take a look at the voting booth. It must use a similar form to post-voting. Update: Looks like this is a JavaScript bug when calling document.evaluate on an XPath - appears to be picking nodes with similar XPaths! Best workaround is to disable the VB node.
  • You do save refreshes especially in the long run. You no longer need to refresh the page (by pressing the "vote" button) before moving to another node.
I must admit I was not expecting to please everyone ;-)
  • Comment on Re^2: AJAX replacement for voting buttons

Replies are listed 'Best First'.
Re: AJAX replacement for voting buttons
by b10m (Vicar) on Jan 03, 2007 at 12:23 UTC
    • This was more a pointer, you may want to include that in your next release
    • Ok, so we disagree
    • Nice workaround ;-)

    The last point requires some more text, so I'll comment on that here.

    IMHO, your GM script (no matter funny and handy) will not help much. You still request a lot of pages and AFAIK, the content is still being returned to the client (we just ignore it at this point). Since we already receive the whole page back, why not strip out the relevant information to update the new "reputation"?

    Also, why not update the "votes left" in the XP Nodelet at the same time? (I don't believe you do that now). That way, in the end, we end up with slightly more page requests, but at least it's fun ;-)

    Right now, I'm actually putting more stress on the PM server, for usually I vote for a few nodes, then hit the Vote button and all is handled in a single page request. I see the amount of votes I have left, and I see the node's reputation. Now I launch a request for every single vote, and I have to launch another one, to see the result!

    "I must admit I was not expecting to please everyone ;-)"

    You've posted code to a critical (and often cynical) audience. Expect feedback ;-)

    --
    b10m

    All code is usually tested, but rarely trusted.
      Thanks, I did appreciate your feedback; my winking emoticon was meant to suggest I had expected feedback of any type :)

      You are correct in that it won't reduce the load on the PM server unless you're like me and press the vote button after reading each post (Used to involve a lot of scrolling!). Ideally, it would be useful if one could specify to the CGI script that you're not interested in the full page being returned just some XML data with node reputation and votes left information.

      If I get a little more time I may add in your suggestions - would involve a bit of webpage scraping using JavaScript :(

        I came up with a custom CSS hack a while ago to let me vote without scrolling. See Re: The big Vote button. It's not what you want if you really want to see the reputation change after each vote, but all I wanted to do was read and mark until I was done with/tired of a thread and then be able to vote without scrolling.

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://592722]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-10-20 19:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?