Discussion:
[Exist-open] escaping function for html attributes
Emmanuelle Morlock
2017-05-09 15:00:26 UTC
Permalink
Dear list,

is there a function that converts a string in something usable in a html attribute? I’m trying to put some tei transformed node in a html template using a bootstrap popover. As I have square brackets in my string (e.g.. dolor sit a[me]t), I need to pass it to an attribute of the element that is animate with javascript


thanks
Emmanuelle
Joe Wicentowski
2017-05-09 15:29:38 UTC
Permalink
Hi Emmanuelle,

Could you please be a little more specific about what you mean by
"something usable in a html attribute"?

Joe
Post by Emmanuelle Morlock
is there a function that converts a string in something usable in a html
attribute? I’m trying to put some tei transformed node in a html template
using a bootstrap popover. As I have square brackets in my string (e.g..
dolor sit a[me]t), I need to pass it to an attribute of the element that is
animate with javascript…
Joe Wicentowski
2017-05-10 11:55:08 UTC
Permalink
Hi Emmanuelle,

Ah, I see. We're you able to find a solution to replacing the pair of
square brackets with a span tag? Or do you still need suggestions for how
to do that?

Joe

On Wed, May 10, 2017 at 7:32 AM Emmanuelle Morlock <
Thanks Joe !
actually I didn’t tested enough. It’s not the the html attribute (a
'data-original-title' on a button element) per se.
the pb came from the fact that the variable I wanted to pass to the
‘data-original-title’ contained span tags and not the brackets
dolor sit a<span class=’something’>met</span> instead of sit a[me]t)

Best
Emmanuelle
Date: 9 mai 2017 at 17:23:17
Sujet: Re: [Exist-open] escaping function for html attributes
Hi Emmanuelle,
Could you please be a little more specific about what you mean by
"something usable in a html attribute"?
Joe
Post by Emmanuelle Morlock
is there a function that converts a string in something usable in a html
attribute? I’m trying to put some tei transformed node in a html
template
Post by Emmanuelle Morlock
using a bootstrap popover. As I have square brackets in my string (e.g..
dolor sit a[me]t), I need to pass it to an attribute of the element that
is
Post by Emmanuelle Morlock
animate with javascript

--
Sent from my iPhone

Loading...