title: POST contact form 7 in addeventlistener wordpress
body: <p>I'm new in javascript and I'm trying to post my contact form 7 data to my another page using <code>addeventlisterner</code> it's working in my console but once I add my ajax it'not... Can someone check my codes if what is wrong? Thanks</p>
  
  <p>Here's my code with working console</p>
  
  <pre><code>    document.addEventListener( 'wpcf7mailsent', function( event ) {
  
      var inputs = event.detail.inputs;
  
      if ( '1286' == event.detail.contactFormId ) {
  
          var fullname = document.getElementById('very-special-field').value; 
          var msisdn = document.getElementById('mobile-number').value; 
          var username = document.getElementById('username').value;
          var email = document.getElementById('email').value;
          var company = document.getElementById('company').value;
          var account_type_id = document.getElementById('account_type_id').value;
  
          form_data = {
              fullname,
              msisdn,
              username,
              email,
              company,
              account_type_id
  
          }
  
          alert('hi');
  
          console.log(form_data);
  
      }
  
  `}, false );
  </code></pre>
  
  <p>BUT if i add my ajax it's not working</p>
  
  <pre><code>document.addEventListener( 'wpcf7mailsent', function( event ) {
  
      var inputs = event.detail.inputs;
  
      if ( '1286' == event.detail.contactFormId ) {
  
          var fullname = document.getElementById('very-special-field').value; 
          var msisdn = document.getElementById('mobile-number').value; 
          var username = document.getElementById('username').value;
          var email = document.getElementById('email').value;
          var company = document.getElementById('company').value;
          var account_type_id = document.getElementById('account_type_id').value;
  
          form_data = {
              fullname,
              msisdn,
              username,
              email,
              company,
              account_type_id
  
          }
          $.ajax({
            type: "POST",
            url: http://myurl.com,
            data: JSON.stringify(form_data),
            success: success,
           dataType: 'json'
          });
  
          alert('hi');
  
          console.log(form_data);
  
      }
  
  }, false );
  </code></pre>
  
  <p>Can someone help me? :( Am I doing this right? </p>