of course the data option is easiest but will break validation the class works too, but what if you define a css class called some or even data? script is the most verbose but will work every time and with type="application/json" it sure looks like the best solution.
On 11/1/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > John Resig schrieb: > > Hi Everyone - > > > > I just finished reading over the massive thread that discusses > > embedding metadata into elements for later extraction. Well, I just > > finished a plugin to handle all three metadata-extraction methods. > > > > You can see a demo here: (Uses Firebug debug statements!) > > http://john.jquery.com/plugins/meta/ > > > > It's capable of extracting metadata from classes, random attributes, > > and child elements. > > > > For example, you can do: > > <li data="{some:'random', json: 'data'}">...</li> > > OR > > <li class="someclass {some: 'data'} anotherclass">...</li> > > OR > > <li><script type="sometype">{some:"json",data:true}</script> ...</li> > > > > The default is the first method, but you can always change it but > > twiddling the options. This means that there is at least one option > > here to appease you. > > > > There's also a bunch of options (like loading data into a single > > property and the ability to ignore braces {}). Let me know what you > > think of this - I know that I'll probably be using it very soon. > > > Looks like I can use this for the form validation plugin and remove my > own meta-data parsing. > > -- > Jörn Zaefferer > > http://bassistance.de > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
