-2

我正在 HP OO 9 中构建一个简单的响应前脚本。myBody 指的是输入变量“body”。我想根据它是否为空来更改正文输入变量的内容。我在第 5 行和第 6 行收到投诉。第 5 行状态missing ; before statement和第 6 行状态syntax error。这里发生了什么?我在这里没有看到任何不寻常的地方。

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

1 回答 1

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

HP OO 9 中的流变量是字符串,因此该值必须包含在一组引号内。

于 2016-07-12T12:12:56.633 回答