var data = { $(this).attr('name') : $(this).val() } $.post('link.php', data, function(){})
I want to give an unknown number of parameters (data) to $ .post. How to implement this? Please throw some example of how to implement this. Thank you.
var data = { $(this).attr('name') : $(this).val() } $.post('link.php', data, function(){})
I want to give an unknown number of parameters (data) to $ .post. How to implement this? Please throw some example of how to implement this. Thank you.
Read about the functions .serialize () and .serializeArray () It is possible that this will solve the breakdown. If not, then you need to drive all the values into the array yourself, which you need to send to the handler.
Source: https://ru.stackoverflow.com/questions/81232/
All Articles