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

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

How do I compare strings in Java? -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -