AdamRoof
AdamRoof

Reputation: 274

Cache jTemplates template URL

Is it possible to cache the template passed into jTemplates? I am loading table data via setInterval every minute and it grabs the template each time, only 1.6kb, but still. From the jTemplates Documentation it seems to accept a caching object but I don't see it working / I think its how I am passing the options object.

    $.ajax({ type: "POST",
        url: "ExternalContent.asmx/RecentOpps",
        async: true,
        contentType: "application/json; charset=utf-8",
        data: "{}",
        dataType: "json",
    success: function (msg) {
        $(".jqOppInfo").setTemplateURL("xml/RecentOppTemplate.htm", {}, { cache: true });
        $(".jqOppInfo").processTemplate(msg);
        $(".jqToolTip").tooltip({ track: true });
    }
});

Upvotes: 2

Views: 88

Answers (0)

Related Questions