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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -