unemployment Posted June 13, 2011 Share Posted June 13, 2011 I want to send usernames to my ajax php script. I have these username set up as an array, but this ajax function doesn't work for me. Do you know why? var users_list = document.getElementsByName('with_username[]'); ajax.get('/assets/ajax/pm_autosuggest.php?info=' + info + '&list' + users_list, function (resp) { var search = eval('(' + resp + ')'); fill_list(search); }); Link to comment https://forums.phpfreaks.com/topic/239276-send-array-through-ajax/ Share on other sites More sharing options...
gizmola Posted June 14, 2011 Share Posted June 14, 2011 The typical solution is to use json, which is a data structure that both php and javascript can work with. Link to comment https://forums.phpfreaks.com/topic/239276-send-array-through-ajax/#findComment-1229383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.