don't know how to integrate my lib name or the field name into the script, ...
so the debug keep showing an error message, i'm new with java but do not want to let go
this is what i did
var entries = anotherLib.find(query);object[“number”] = entries[i].field(“product id”); // Replace with yours
var resultArray = [];
for(var i in entries ) {
var object = {};
object[“title”] = entries[i].title;
object[“desc”] = entries[i].description;
resultArray.push(object);
}
result(resultArray);
Assuming the libByName() call is your first line, I do notice that there is no semicolon act the end of that line; it should have one. I don't see any other problem with it.
So try adding a semicolon right after the close parenthesis character and see what happens. "Illegal character" doesn't sound right to me for that, but you never know how a parser will sense a problem; the error message sometimes doesn't make a lot of sense, though it usually does.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Illegal_character
Wiki websites and some word editors use what is called "non-standard quotation marks" where the opening double quote is different than the closing double quote. This is usually for aesthetics, however when you copy the example code from the wiki page and past it into the script editor you'll get an error because one of the quotes is not an acceptable character for the debugger.
So change the ("") for all of the quotes by retyping them. As long as your not using a word processor or something that would change it, your keyboard (on your smartphone, computer, etc...) should use "simple quotation marks".
Hope this helps! Got the same error and that is what I did to fix it.
- Logan (DarkComet)