gpt4 book ai didi

javascript - 我可以使用 JavaScript 变量来查询 Neo4j 吗?

转载 作者:行者123 更新时间:2023-12-03 11:17:52 24 4
gpt4 key购买 nike

我想知道是否可以使用本地 userInput 变量来修改查询。 IE。用户通过此输入表单提供的名称:

<input type="text" id="userInput"></input>

像这样:

var body = JSON.stringify({
statements: [{
statement:'MATCH (tom {name: "userInput"}) RETURN tom' //'MATCH (n) RETURN n'

}]
});
$.ajax({
url: "http://localhost:7474/db/data/transaction/commit",
type: "POST",
data: body,
dataType: "json",
contentType: "application/json"

})

.done(function(result){
console.log(result.results);

最佳答案

是的。获取通过 id 输入的文本并访问值,如下所示:

document.getElementById('userInput').value

关于javascript - 我可以使用 JavaScript 变量来查询 Neo4j 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27254983/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com