1

See this question for the full story.

This is what I have:

<input type="text" data-provide="typeahead" data-source='@Html(param)' data-items="4">

Say @param evaluates to [&quot;can&#x27;t&quot;,&quot;hi&quot;, &quot;boom&quot;] without the @Html() escaping, and ["can't","hi", "boom"] with @Html().

Is it possible for me to call @Html(parameter) here but escape the conversion from &#x27; to ' ?

Community
  • 1
  • 1
Meredith
  • 3,928
  • 4
  • 33
  • 58
  • 1
    The short answer is no. For security reasons, everything inside a `@Html` tag will get converted. Is there a reason you'd like to do this? Maybe you could let it convert then use jquery/javascript to substitute all single quotes with `'` – Omar Wagih Jun 15 '13 at 15:34
  • The reason I wanted to do this was because I didn't understand how Typeahead worked, and what part of the plugin was getting the contents of the data-source attribute. Then I learned that AJAX exist, so I'm now using that to get data from my database to typeahead and not passing information to Typeahead via the data-source attribute and Play's HTML template engine, but through the parameters to Typeahead. – Meredith Jun 16 '13 at 17:52
  • 1
    For typeahead, you might want to take a look at [select2](http://ivaynberg.github.io/select2/) – Omar Wagih Jun 16 '13 at 18:07

0 Answers0