views:

59

answers:

1

Using .NET, mootools/JavaScript.

I want to create a trophy mechanism similar to SO's badges. So when a user recieves a trophy, a small fading DIV will appear at the top of his page. Problem is, I need to keep checking against my DB if the user recieved a new trophy or not.

How would you approach it? Would love to get code samples if you did something similar.

+2  A: 

Are you already using mootools for the client-side interaction? Look at the FX stuff in mootools. Essentially you'll want to have a script check for server-side updates in a queue for a user every X seconds. From the response, you can inject an object into the DOM with absolute positioning. Having the appropriate stuff. Within FX you have tweening where you can have it animate the showing/hiding of the item in question. The server-side piece (ASP.Net) would probably be best handled as an ASMX, ASHX, or WCF service endpoint. You can use the JsonSerializer to encode your responses for the service.

If you need more specific information, I would suggest posting a more specific question.

Tracker1