[BACK]Return to form.min.js CVS log [TXT][DIR] Up to [local] / draft

Diff for /draft/form.min.js between version 1.20 and 1.21

version 1.20, 2024/03/28 18:59:17 version 1.21, 2024/03/28 19:02:01
Line 13  function validateMsg(msg) {
Line 13  function validateMsg(msg) {
         return (msg.length>5);          return (msg.length>5);
 }  }
   
   async function postData() {
     const formData = new FormData(form);
     try {
       const response = await fetch("https://example.org/post", {
         method: "POST",
         body: formData,
       });
       console.log(await response.json());
     } catch (e) {
       console.error(e);
     }
   }
   
 async function sendData() {  async function sendData() {
         const form = document.querySelector("#cform");  
         const formData = new FormData(form);  
         var er = 0;          var er = 0;
                 em = document.getElementById("cfem").value,                  em = document.getElementById("cfem").value,
                 su = document.getElementById("cfsu").value,                  su = document.getElementById("cfsu").value,
Line 44  async function sendData() {
Line 55  async function sendData() {
                                 callback: function(token) {                                  callback: function(token) {
                                         ii.textContent="Sent";                                          ii.textContent="Sent";
                                         console.log(`Challenge Success ${token}`);                                          console.log(`Challenge Success ${token}`);
 /* ---------- */                                          postData();
   try {  
           console.log(`TRY`);  
     const response = fetch("https://draft.hgk.global/feedbk/", {  
       method: "POST",  
       body: formData,  
     });  
         console.log(`AWAIT`);  
     console.log(await response.text());  
           console.log(`RESPONSE`);  
   } catch (e) {  
                                                 console.log(`ERROR`);  
     console.error(e);  
   }  
 }  
 /* ---------- */  
   
                                 },                                  },
                         });                          });
                 });                  });

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

https://cvs.kroczynski.net