Binding Server data to control for event handler parameters
I'm wondering what the best way to go about binding data from the server to an html element would be so that I can pass in data to an event handler. The two methods I've observed thus far are using the data() function from jQuery, but I'm mostly returning HTML data in my ajax requests and so I'm not sure how I could gracefully pass the parameters back in the response. The other option I've seen is using custom attritubes within the html tag, but that doesn't appear to validate with W3C. I'm binding all my event handlers with jQuery after the HTML loads into the DOM.
Any suggestions as to a best practice or which of these two methods is more preferred?
Thanks in advanced!