我有一段 Javascript 代碼,我試圖將其配置為將捕獲的表單數(shù)據(jù)發(fā)送到 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,但正文是空的。鉤子的發(fā)布者提供的用于發(fā)布正文的示例是:"data": "{\"hello\":\"world\"}"反斜杠轉(zhuǎn)義以添加引號(hào)的位置。我想我需要在外部引號(hào)之間獲取該代碼塊中的數(shù)據(jù)字段。
使用 Javascript 存儲(chǔ)和發(fā)送來自任何網(wǎng)站表單的輸入數(shù)據(jù)到 webhook
紅顏莎娜
2021-06-19 09:12:30