Retrieving info using $.get
Is it possible to retrieve an array along with html using the $.get method? Something like so:
- $('#btn').live('click', function(){
var choices = [];
$('input.choice:checked').each(function(i){
choices[i] = this.value;
});
$.get('/process.php', {
action: 'update',
choices: choices
}, function (html) {
$('#content').html(html);
// could I also collect an array here from the process.php file?
});
});
I'm sending over an array and storing it in a session array, and on return I want to check that session array and be able to enable and disable a button..
If I can't collect an array on success, then could I get some recommendations as to how I should rethink this situation?