I'm having hard time figuring whats going wrong with my codes, seem like there is a missing '}' in the string that i'm trying to parse. So basicalluy what i'm trying to do is to execute javascript code with the aide of javafx api,
javascript function
function fillWaypoints(location){
ArrayWaypoints.push(location)
}
java codes to execute javascript
@FXML
public void displayDirection(){
for(int i =0;i< lists.get(0).size() ;i++){
System.out.println("routes -->"+lists.get(0).get(i));
engine.executeScript("fillWaypoints("+lists.get(0).get(i)+")");
}
The output of
lists.get(0).get(0) for example is
{location: Antoine Vallasois Ave, Vacoas-Phoenix, England, stopover:true}