Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2010, 04:15 PM   PM User | #1
AbbottF
New to the CF scene

 
Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
AbbottF is an unknown quantity at this point
jTemplates object error

I have a WCF connection returning a JSON object to page. jTemplate throws a ..
'$T.ContentType' is null or not an object

what am I doing wrong? If the JSON in error? Is the Template bad?

Thanks
Abbott

the JSON ..

GetContentResult
{"ContentType": "Sermons",
"ContentEntry":
[
{
"ContentEntryID":1,
"ProviderID":1,
"Name":"Paul Alcorn",
"Title":"Today Is Great",
"Tip":"Just like every other day",
"Date":"\/Date(1262494800000-0500)\/",
"LinkID":1,
"URL":"First Entry"
}
]
}

for the template ...
<%-- Results Table Template with Header --%>
<script type="text/html" id="ContentsTable">
{#template MAIN}
<div>
<div>{$T.ContentType.bold()}</div>
{#include CONTENTENTRY root=$T.ContentEntry}
</div>
{#/template MAIN}

*** main table ***
{#template CONTENTENTRY}
<table>
<tr style="background-color:Maroon;color:White;">
<th>ID</th>
<t>Date<th>
<th>pID</th>
<th>Name</th>
<th>Title</th>
<th>Tip</th>
<th>lID</th>
<th>URL</th>
</tr>
{#foreach $T as entry}
{#include ROW root=$T.entry}
{#/for}
</table>
{#/template CONTENTENTRY}

{#template ROW}
<tr class="{#cycle values=['','evenRow']}">
<td>{$T.ContentEntryID}</td>
<td>{$T.ProviderID}</td>
<td>{$T.Name}</td>
<td>{$T.Title}</td>
<td>{$T.Tip}</td>
<td>{$T.LinkID}</td>
<td>{$T.URL}</td>
</tr>
{#/template ROW}
</script>
AbbottF is offline   Reply With Quote
Reply

Bookmarks

Tags
jquery, json, ttemplates, wcf

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:02 AM.


Advertisement
Log in to turn off these ads.