Creating a JS Array
var array=new array ();
Creating Arrays in Java
Private string[] Array=new string[3];
Two completely different, JS is variable-length
Add content
Array.push (something);
In Java
array[0]= "ABC";
Array to String
Array.join (",")
In Java
String str=arrays.tostring (array);
Related application code:
functionDoDelete () {//determine if the record is selected varrows = $ ("#grid"). DataGrid ("Getselections"); if(rows.length===0) {$.messager.alert (' System Information ', ' Please select at least one record operation! ', ' warning '); }Else{ //ask if you want to delete$.messager.confirm (' System info ', ' Confirm the deletion? ‘,function(r) {if(r) {//creating a JS Array object varArray =NewArray (); //submit a Delete request to submit multiple IDs to the server side for(vari=0;i<rows.length;i++){ varCourierid =rows[i].id; //The push () method adds one or more elements to the end of the array and returns the new lengthArray.push (Courierid); } //use the Join () method to compose all elements of an array into a string. varids = Array.join (","); Window.location.href= "${pagecontext.request.contextpath}/courieraction_deletebantch.action?ids=" +IDs; } }) }}
Creation of arrays in JavaScript add and convert arrays to strings