Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript ajax receive multiple values

// At the time of writing best bet is to do this:

// Construct a string from your response and separate the items with a comma
// Lets say your request sends response a string like this: '1,2'

$.ajax({
	url: '<myUrl>',
	//data: { "id": id },
	//async: false,
	success: function (data) {
		var response = data.split(",");
		var first = response[0];
      	var second = response[1];
      	// ... etc.
	}
}
 
PREVIOUS NEXT
Tagged: #javascript #ajax #receive #multiple #values
ADD COMMENT
Topic
Name
3+1 =