title: jquery template not rendered from ajax data
body: <p>Below code works if I hardcode the json string, however if I pass the json string returned from ajax call to render the template, it does not work. Please help me to find the issue.</p>
  
  <pre><code>   function getData(orgId){
  
     $.template("EmployeeTemplate","&lt;tr&gt;&lt;td colspan='2'&gt;${name}&lt;/td&gt; 
      &lt;td colspan='2'&gt;${id}&lt;/td&gt; &lt;td colspan='2'&gt;${jobTitle}&lt;/td&gt;&lt;/tr&gt;");
  
      var gUrl = "/JQueryMobileApp/HRServlet?action=employee&amp;orgId="+orgId;
  
      // Do the ajax call 
      $.ajax({ 
        url: gUrl, 
        dataType:'json',
        // Callback (onsuccess) 
        success: function(d){ 
  
         var jsonData = eval( d); 
  
         var nameText=jsonData.empNames;
         //nameText=[{name:"abc",id:"1"},{name:"pqr",id:"2"}];
         $.tmpl( "EmployeeTemplate", nameText ).appendTo( "#employeeList" );
        alert(nameText);
  
        }, 
        // Error handler 
        error: function(req, status, err){ 
          alert('error getting name');
          var group_list = document.getElementById("orgTree"); 
  
        } 
      }); 
       }
  </code></pre>
  
  <p>code on the server side:</p>
  
  <pre><code>                PrintWriter out = response.getWriter(); 
          response.setContentType("application/json");
          JSONObject obj1=new JSONObject();
         if(request.getParameter("action").equals("employee")){
  
              String orgId=request.getParameter("orgId");
  
          List&lt;EmployeeVO&gt; name=access.getEmployeeListInOrganization(orgId);
  
          Gson gson = new Gson();
          String json=gson.toJson(name);
          obj1.put("empNames",json);
  
  
          out.print(obj1); 
          out.flush();
                     }
  </code></pre>
  
  <p>I am using the same approach to fill a text box with the name of employee returned from ajax call and I am seeing that its being populated. However if the return type is a json array I am not able to display it. Display logic is correct as if I hardcode the json array I am able to see the list and table. Response code is success, the logic is not going in to error condition.</p>