[英]How to pass a string array from javascript to asp.net webservice?
I am creating Google Chrome Extension Project.我正在创建 Google Chrome 扩展项目。 I have a string array and I want to pass this array to my web service and take the array again.
我有一个字符串数组,我想将此数组传递给我的 Web 服务并再次获取该数组。 How can I do this?
我怎样才能做到这一点? Should I need a database for this or I can communicate directly between them?
我应该为此需要一个数据库还是我可以直接在它们之间进行通信?
function myFunction(selectedText) {
var selected = selectedText.selectionText;
var yenidizi = new Array();
var words = new Array(); // This is my array and I want to pass this array to my web service.
for (var i = 0; i < words.length; i++)
{
for (var j = 0; j < words[i].length; j++)
{
var newstring = words[i];
var temp = null;
words[i] = temp;
temp = newstring;
words[i] = temp;
newstring = null;
}
}
} }
It's recommended to have a look at Getting Started AJAX , code would be something like the following建议看一下Getting Started AJAX ,代码如下
var yourArray = [,];
$.post(url, { data: yourArray}, function (response) {
// your callback here
}, "text");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.