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 -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -