javascript - return array response to destination file jquery ajax php -
am trying populate fields automatically behalf of user typed in particular input field. eg: want populate automatically username
, age
when type fullname
, trouble when receive data in array() can use single element either in age field or in username field, want ::
$.ajax({url: "/php/autofill.php?query="+query, success: function(result){ $("#ajax").html(result); }});
can fetch below?
$.ajax({url: "/php/autofill.php?query="+query, success: function(result){ $("#ajax").html(result.username); //or $("#ajax").html(result.age); }});
i know code dirty, want way anyhow, looking answers
Comments
Post a Comment