我有一段 Javascript 代码,我试图将其配置为将捕获的表单数据发送到 webhook。var name = document.getElementById("pwebcontact1_field-name").value;var email = document.getElementById("pwebcontact1_field-email").value;var phone = document.getElementById("pwebcontact1_field-phonenumber").value;var zillow = document.getElementById("pwebcontact1_field-yourzillowprofilelinkcopyandpastehere").value;var data = {name: name.value,email: email.value,phone: phone.value,zillow: zillow.value};$.ajax({url: 'url',method: 'POST',contentType: 'application/json',crossDomain: true,headers: { 'authkey': 'key'},data: JSON.stringify(data) }).success(function(response) {console.log(response);});URL 和 authkey 已配置。它通知了 webhook,但正文是空的。钩子的发布者提供的用于发布正文的示例是:"data": "{\"hello\":\"world\"}"反斜杠转义以添加引号的位置。我想我需要在外部引号之间获取该代码块中的数据字段。
添加回答
举报
0/150
提交
取消