On Sun, Mar 19, 2017 at 3:42 PM, Dimitris Zenios <dimitris.zen...@gmail.com>
wrote:

> My only concern is with
> /tapestry-core/src/main/preprocessed-coffeescript/org/
> apache/tapestry5/t5-core-dom.coffee
>
> +#if jquery
> +      value = $(element).data(attribute)
> +#elseif prototype
> +      value = JSON.parse($(element).readAttribute('data-' + attribute))
> +      if value isnt null
> +        value = JSON.parse(value)
> +      else
> +        value = {}
> +#endif
>
> What happens when not jquery neither prototype is used.Instead it should
> use the dom api.
>

Unless you're talking about running Tapestry without any traces of jQuery
nor Prototype, which isn't supported, then this won't be a problem. But you
raise an interesting point. :) I did research for a framework-free, vanilla
JS solution for reading data attributes, which actually exists (the DOM
dataset property, described in
https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes),
but it's not supported by Internet Explorer 10 and older versions. I'd love
to see Tapestry provide a vanilla JS infrastructure, but browsers,
specially IE, are not there yet.

-- 
Thiago

Reply via email to