On 01/01/2013 01:29 PM, Alex Brollo wrote:

> As I told, I don't know if HTML5 is in use or not; but try to save a <span
> id="container" data-test="This a test data"></span> into the raw code of
> any page, then save it, and then use js console of Chrome from the resultin
> page in view mode with this:
> 
> $("#container").attr("data-test")

It's not a big deal for this use case, but you can also do:

console.log($("#container").data("test"));

Besides saving a little typing, it will do automatic JSON decoding of
the value.

Matt Flaschen

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to