Getting TypeError: invalid 'in' operand obj while fetching data using ajax <p>Below is my ajax call</p> <pre><code> $(document).ready(function() { $("#blog").focusout(function() { alert('Focus out event call'); alert('hello'); $.ajax({ url: '/homes', method: 'POST', data: 'blog=' + $('#blog').val(), success: function(result) { $.each(result, function(key, val) { $("#result").append('&lt;div&gt;&lt;label&gt;' + val.description + '&lt;/label&gt;&lt;/div&gt;'); }); }, error: function() { alert('failure.'); } }); }); }); </code></pre> <p>I am getting 'TypeError: invalid 'in' operand obj ' error in my console</p> <p>In advance thank you</p>