I'm having an issue with trying to get two JavaScript arrays and use them in B4J. This is the instructions I get form the site:
Array 1: doc.getSelections(?lineSep: string) → array<string>Returns an array containing a string for each selection, representing the content of the selections.
Array 2: doc.listSelections() → array<{anchor, head}>Retrieves a list of all current selections. These will always be sorted, and never overlap (overlapping selections are merged). Each object in the array contains anchor and head properties referring to {line, ch} objects.
JS Code:
JavaScript:
getSelections: function(lineSep) {
var parts = [], ranges = this.sel.ranges;
for (var i = 0; i < ranges.length; i++) {
var sel = getBetween(this, ranges[i].from(), ranges[i].to());
if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }
parts[i] = sel;
}
return parts
},
listSelections: function() { return this.sel.ranges },
I'm using this to get the javaobject
B4X:
Dim JSO As JavaObject = ExecuteScript($"editor.getSelections(",");"$)
I have an Array var cars = [2,3,..] which holds a few integers. I've added a few values to the array, but I now need to send this array to a page via jQuery's .get method. How can I convert it to a...