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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -