jQuery tmpl: How do I render Html?
Asked Answered
I

2

21

Okay, I'm in a sitiuation with jQuery, the tmpl-plugin and this:

${$value.Text}

This is okay and works fine but as I just found out via the documentation:

Using {{html fieldNameOrExpression}} is equivalent to using ${fieldNameOrExpression}, except that it renders unencoded text into the HTML DOM, whereas ${} encodes values by default.

Okay fine. But I can't get the {{html}} tag to work with my ${$value.Text}.

I tried things like {{html ${$value.Text}} or {html ${$value.Text}} but it just doesn't work.

Incogitant answered 11/4, 2011 at 8:50 Comment(0)
H
20

The correct syntax is:

{{html $value.Text}}
Haimes answered 11/4, 2011 at 8:54 Comment(2)
If you're working within Laravel's blade, like I am, you will need to escape out of it. Example: @{{html value}}Fiorenza
This did not work for me. The other answer is what worked.Hirsch
I
18

What worked for me was:

{{html value.Text}}
Irrepealable answered 17/12, 2013 at 22:22 Comment(1)
This worked fine ex. {{html GeneralComments}}, thank youSheik

© 2022 - 2024 — McMap. All rights reserved.