views:

74

answers:

1

I want a widget that allows users to add a request if that request hasnt already been added, or vote for a request if it has already been added. when a user adds a request, i want it to immediately appear as the first element of the list, like what would happen to your timeline if you made new tweet. ive tried to look for a jquery plugin that offers this functionality, but i was unsuccessful (maybe i couldnt think of the right terms to search for??).

i dont have enough faith in my js skills to write this from scratch, so id rather find a template to start with. Thanks.

+1  A: 

I don't think that would be very hard to create from scratch, although I'm not very familiar with JScript

In a conceptual model:

Create the form to add the request

Store it somewhere (XML, Database, ... whatever you feel it suits your needs)

Retrieve it from the database/XMl file, sorting it by post date or lastvote date (whichever is new)

Edit:

Ah! So the part you're looking for is right after the request is posted, you want it to appear in the top of the list, without refreshing the page. Is that it?

With JScript, just raise an Event when the user clicks the post button that handles posting.

That event would trigger a function that would re-run the database query, for instance (if that is handled by Jscript and not by a ServerSide API - I'm not even sure if JScript can query a database =P). Or... it could just insert some HTML in the top of the list. If its a table, something like:

document.write("<tr><td>" + Request_Title + "</td></tr>
                <tr><td>" + Request_Text + "</td></tr>
                <tr><td>" + Request_Author + "</td></tr>")

that should do the trick

Tivie
yea youre right, that part ive got that down, what im looking for is something that acts like the timeline on twitter:-When a new request is created, it is tagged onto the top of the list
culov
I realized, after you edited your post, that you're prolly looking for something like the Stackoverflow mechanism LOL
Tivie
Add a request_date order by date desc... and roberts your aunties brother
Mauro