twinstone / tdi

Turbocharged DOM Infusion
Apache License 2.0
6 stars 1 forks source link

Treat update/insert target attribute as ID #14

Closed centi closed 7 years ago

centi commented 7 years ago

Sometimes, the ID attribute (used as target) contains characters which have special meaning in CSS selectors (dot, colon). Using $(id) method causes troubles in these cases.

As the target attribute must contain only ID anyway, TDI should use something like this to find the target element: $(document.getElementById(target))

mishal commented 7 years ago

We never use anything special in the target attribute, just simple id.

centi commented 7 years ago

ID attribute can also contain a dot . and a colon : (see. https://www.w3.org/TR/html401/types.html#type-name).

So there is a chance, that a valid ID attribute will not work with TDI and the $(id) call, because it will try to treat the id as a valid CSS selector. This is the reason for this issue.