0

When I am using Mustache.to_html method it is returning me empty string (“”) . but when I am debugging code and moving ahead by using check points than I am getting my template, Why I am getting such kind of behavior ? My code is like that -

    var temp = $.get(/templates/mytemplate);
    var data = {
               name : "john",
   };
    var html = Mustache.to_html(temp,date);

I am getting html as "" but by using breakpoing I am getting correct html. Why ?

Anshul
  • 9,312
  • 11
  • 57
  • 74
  • Looks like this problem http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call, also you seem to be missing quotes... – elclanrs Jul 02 '13 at 08:20

1 Answers1

0
var temp = $.get(/templates/mytemplate);
    var data = {
               name : "john",
   };
var html = Mustache.to_html(temp,data);

There is spelling mistake like date instead of data..

kleopatra
  • 51,061
  • 28
  • 99
  • 211
vijay
  • 1