On Thu, Sep 24, 2009 at 12:10 PM, Kevin Dalman <kevin.dal...@gmail.com> wrote:
>
> If you need data for multiple fields, then a 3rd option is to create a
> single hash/data object for the page and writing all your data into
> that. This makes your data easy to read and debug, and is highly
> efficient because you don't have to 'parse' anything...

And while all of the above are true, a 4th (not necessarily better)
option is to have a <script> block on the page that is NOT
language="text/javascript".  That results in a valid page that
nonetheless has the data available to Jquery.

http://ejohn.org/blog/javascript-micro-templating/

That said, however, I'd say:
If the data is JS specific, drop it into the attribute data.
If the data could be relevant to other consumers of the page (even if
they don't exist yet) the suggestion for the class attr sounds solid.

-- 
Brett Ritter / SwiftOne
swift...@swiftone.org

Reply via email to