DracoBlue / jsb

A very extendable Toolkit to inject Javascript Behaviour into rendered HTML without Inline Javascript. (jsb was formerly known as JsBehaviourToolkit)
http://dracoblue.net
Other
52 stars 8 forks source link

Remove input[hidden] source for jsb data #17

Closed DracoBlue closed 10 years ago

DracoBlue commented 10 years ago

In the first version of jsb, it is possible to use:

<div class="jsb_ jsb_Name">
  <input type="hidden" value="key=value">
</div>

to load data.

Since everybody(?) uses the new:

<div class="jsb_ jsb_Name" data-jsb="key=value">
</div>

we might remove the hidden-input feature.

OskarStark commented 10 years ago

+1

selfawaresoup commented 10 years ago

+1

eberdt commented 10 years ago

+1

larslaade commented 10 years ago

+1

but then you loose the possibility to add more than one behavior to the same element.

for example: two behaviors with two different data-json values

<div>
  <input class="jsb_ jsb_Name1" type="hidden" value="key1=value1"/>
  <input class="jsb_ jsb_Name2" type="hidden" value="key2=value2"/>
</div>

i know this is a extreme case but currently possible.

selfawaresoup commented 10 years ago

@larslaade see #16, we're discussing that over there.

graste commented 10 years ago

I think it's okay to remove the input-type-hidden feature when #16 gets a feasible solution. The older jsb versions still work w/ input type hidden and thus we just need to make sure the BC break is mentioned in prominent places. :-)

axten commented 10 years ago

+1 and we have the benefit that data-jsb attribute can be optional, yeeaha!!