BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.

Home Page:http://www.jsviews.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$(...).render is not a function

yellareddy-allcloud opened this issue · comments

@*Add*@
    </th>
    <th>Order</th>
    <th>Name</th>
    <th>Sub Section(s)</th>
  </tr>
</thead>
<tbody id="person"></tbody>
<script id="tabsTemplate" type="text/x-jsrender"> {{for TabInfos tmpl='#trTabTemplate' /}} </script> <script id="trTabTemplate" type="text/x-jsrender"> </script>

when am trying to click Add option, adding new row as like as below :

function addTabRow() {

  debugger;

  JqueryAjaxCall('@Url.Action("AddTabRow", "Home")', 'JSON', $("#tblTabs *").serialize(), 'Post', false, function (resp) {

    debugger;

    $("#tblTabs").html(
      $("#tabsTemplate").render(resp.RenderMasterUI)
    );
  
  });
}

throwing .render is not a function

If you load jquery.js and then jsrender.js (or jsviews.js), then $(...).render will be a function.

Are you doing something in JqueryAjaxCall (or in the callback ) which is somehow unloading jsrender.js, or reloading the whole page without jsrender.js?

At any rate this does not correspond to a known bug in jsrender.js, so resolving as N/A for now.

If you still have a problem, can you post a complete sample (on jsfiddle for example) showing the issue?

Thanks.