Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello.

I have set data using jtempates but i got error."Uncaught TypeError: $(...).setTemplateURL is not a function"

i m using this reference "Using the jTemplate jquery plugin with ajax and ASP.NET | Joe Stevens' Blog[^]

and my code is :-

HTML
<script src="../js/jquery.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="http://localhost:46740/Momtaz/User/js/jtemplates.js"></script>
<script>
    $(document).ready(function () {

        BindData("All");
    });
    function BindData(name) {
        $.ajax({
            type: "POST",
            url: 'http://localhost:46740/Momtaz/User/MemberDetails.aspx/GetData',
            data: JSON.stringify({ 'tName': name }),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            async: true,
            success: function (data) {
                debugger;
                var placeData = data.d;
                $('#divMemberPlaceData').html("loading..");
                $('#divMemberPlaceData').setTemplateURL('User/htmlFile/AllMember.html');
                $('#divMemberPlaceData').processTemplate(placeData);

            }
        });

    }
</script>


What I have tried:

<script src="../js/jquery.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="http://localhost:46740/Momtaz/User/js/jtemplates.js"></script>
<script>
$(document).ready(function () {

BindData("All");
});
function BindData(name) {
$.ajax({
type: "POST",
url: 'http://localhost:46740/Momtaz/User/MemberDetails.aspx/GetData',
data: JSON.stringify({ 'tName': name }),
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
success: function (data) {
debugger;
var placeData = data.d;
$('#divMemberPlaceData').html("loading..");
$('#divMemberPlaceData').setTemplateURL('User/htmlFile/AllMember.html');
$('#divMemberPlaceData').processTemplate(placeData);

}
});

}
</script>
Posted
Comments
Karthik_Mahalingam 10-Sep-16 23:40pm    
post the template file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900