mardi 12 juillet 2016

Syntax error in JavaScript (Rhino) if/else statement in HP OO 9

I'm building a simple pre-response scriptlet in HP OO 9. myBody refers to an input variable "body". I want to change the content of the body input variable depending on whether or not it is empty. I'm getting a complaint on line 5 and 6. Line 5 states missing ; before statement and line 6 states syntax error. What is going on here? I don't see anything unusual here.

myBody = body;
if (!myBody || myBody.length === 0) {
    body = "There are currently no unassigned servers to report.";
} else {
    body = ${myReport};
}

Aucun commentaire:

Enregistrer un commentaire