I get ajax response as JSON and need to fill a form with it. How to do that in jQuery or something else ? Is something better than using $(json).each() ?
$(json).each()
Assuming data is the JSON object, you could use this inside the $.getJSON callback:
data
$.getJSON
var $inputs = $('form input'); $.each(data, function(key, value) { $inputs.filter(function() { return key == this.name; }).val(value); });