javascript - How can I set a unique indentifier on HTML gadgets, when I can't use ID and need to reference the gadget repeatedly? -
i'm using plugin (called renderjs) allows build html pages reusable gadgets (html5 mashups). default gadget this:
<div id="header" data-gadget-module="header" data-gadget="html/modules/header.html"></div> the plugin keeps index of gadgets, making invidiual gadgets accessible through id=header", under gadget stored in gadgetindex.
my problem is, i'm using along jquerymobile, i'm no friend of using id-attributes since want instantiate , re-use gadgets (like above, should go on every page).
i have checked instantiation inside jqm , jqueryui (both using jquery ui widget factory) among other things assigns every widget instance unique uuid.
my question:
how best set unique indentifier on resuable gadgtes, if these have referenced often?
i assign running counter on every gadget i'm creating , assign somewhere on gadget-proto-object, since need reference gadgets uuid lot , have manage gadget state through urls (= gadgets of page might end in url), i'm wondering what's best way label , identify gadgets if can't use ids?
Comments
Post a Comment