asp.net - jTemplate and MicrosoftAjaxTemplates encode or decoded html (browser not render as html) -
i using jtemplate showing rss item in page. description of each item not render right.
my template is:
<table>   <thead>     <tr>       <th>date</th>       <th>title</th>       <th>description</th>     </tr>   </thead>   <tbody>     {#foreach $t.items post}     <tr>       <td>{$t.post.pubdate}</td>       <td><a href="{$t.post.link}">{$t.post.title}</a></td>       <td>{$t.post.description}</td>     </tr>     {#/for}   </tbody> </table>   but when render page, see tag(or encoded tag) instead of render html in description column:
< ;table border=0 width= valign=top cellpadding=2 cellspacing=7& gt;& lt;tr& gt;& lt;td width=80 align=center valign=top& gt;& lt;font style="font-size:85%;font-family:arial,sans-serif"& gt;....
and when html decode on server side, see:
<table border=0 width= valign=top cellpadding=2 cellspacing=7><tr><td width=80 align=center valign=top><font style="font-size:85%;font-family:arial,sans-serif">....
what's problem?
note: test microsoftajaxtemplates , see same problem, when using string it's ok $('.desc').append(' html tag');
jtemplates escapes html default. can change changing property on optional settings object third argument so:
.settemplate("#template", null, { filter_data: false });
Comments
Post a Comment