小编Rus*_*tam的帖子

选项“align_double_arrow”、“align_equals”不存在。定义的选项有:“默认”、“运算符”

在我的 php-cs-fixer.php 中我有这一行:

'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => true],
Run Code Online (Sandbox Code Playgroud)

它给了我一个错误:

The options "align_double_arrow", "align_equals" do not exist. Defined options are: "default", "operators". 
Run Code Online (Sandbox Code Playgroud)

你能帮助我们operators and default实现同样的目标吗?

php php-cs-fixer

3
推荐指数
1
解决办法
1131
查看次数

即使我不读http请求的响应体,是否也需要关闭它?

我有以下代码:

resp, err = http.Head("http:something.com")
if err != nil {
    //do something
}

if resp.StatusCode == http.StatusOK {
    // do something     
}
Run Code Online (Sandbox Code Playgroud)

由于我没有阅读 的正文,因此resp我假设我不需要像 那样关闭它resp.Body.Close()。我的假设正确吗还是我应该打电话resp.Body.Close()

go go-http

3
推荐指数
1
解决办法
3942
查看次数

AppendChild 到 Class 的每个元素

我想将一个元素附加到“actors”类的每个 div 中,但是我编写的函数只在最后一个元素中添加了“actors”类的元素(我的页面中有两个)。你能帮我如何在 JS 中正确 appendChild 吗?

async function addActor() {
    let actor_name = document.getElementById("actor_name").value;
    let element = document.createElement("p");
    element.innerHTML = `<p>${actor_name}<input id="scriptText" style="width: 40px;" type="text" name="" value="0"></p>`;
    console.log(element);
    let collection = document.getElementsByClassName("actors");


    for(let item of collection){
        await item.appendChild(element);
        console.log(item.innerHTML);
    }
}```
Run Code Online (Sandbox Code Playgroud)

html javascript appendchild

1
推荐指数
1
解决办法
297
查看次数

标签 统计

appendchild ×1

go ×1

go-http ×1

html ×1

javascript ×1

php ×1

php-cs-fixer ×1