javascript - How to pass array in XHR.get request of Luci openwrt? -


i trying send array javascript xhr.get request in luci openwrt .

var myarray[] has contents . example : `myarray[] = {"1","2","3"}`  

i need pass array xhr.get requests arguments . how can pass array ?

this sample code :

xhr.get('<%=request_uri%>', {status: 2,value: myarray},     function(x, info) {         if (!info) {             location.href=location.href;         }         else {             console.log("success");         }     } ); 

and in lua code receiving form data :

if luci.http.formvalue("status") == "2"     local detailvalue[] = luci.http.formvalue("value")     local filecontent = {         content = "sample1",         find = "sample2"     }     luci.http.prepare_content("application/json")     luci.http.write_json(filecontent)     return end 

but getting errors. correct way send array via xhr.get ? suggestions ?


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -