I am working on a Google Chrome Extension. I have string array and I need post my array to web service with ajax and return again. Here is my code:
var data = {};
data.param1 = words; // my string array
$.ajax({
data: JSON.stringify( data ),
dataType: "json",
url: 'http://localhost:49242/Service.asmx',
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (result) {
alert("basarili");
},
failure: function(errMsg) {
alert(errMsg);
}
});
Service:
public string example(string[] param1) {
string result = param1[0];
return result;
}
I am not getting an error but this code is not working. How can I solve?
param1[""param1"]?