title: Parsing JSON object in JavaScript/JQuery
body: <p>I have a Json object as following.</p>
  
  <pre><code>{
  "firstName":"John", 
  "lastName":"Doe"
  "123":"456"
  }
  </code></pre>
  
  <p>I want to access they keys and value. After reaching, I will set them into fields. But I don’t why it doesn’t work. I’ve checked its syntax has no problem.</p>
  
  <p>What I’ve tried,</p>
  
  <pre><code>$(document).ready(function f() {
      $.ajax('http://soner.dev/test.txt', {
          success: function(data, status, xhr) {
              $(data).each(function(i,val)
              {
                  $.each(val,function(key,val)
                  {
                      console.log(key + " : " + val);     
                      alert(key + " : " + val);  
                      $('#{key}').val(val);   
                  });
              });
              setTimeout(f, 1000); // refresh the data at each second(data changes at each 1sec)
          }
      });
  }); 
  </code></pre>
  
  <p>By the way, <code>$('#{key}').val(val);</code> in which I try to use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals" rel="nofollow noreferrer">Template Literals</a>.</p>