title: How to do ajax request and get response from Android Webview?
body: <p>I am new in Android Hybrid App. I want post token in ajax request and Get ajax response.</p>
  
  <p><em>My Webview is here</em></p>
  
  <p><a href="https://i.stack.imgur.com/RQNPh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RQNPh.png" alt="enter image description here"></a></p>
  
  <p>In This webview 3 field post by ajax from php side but I want when click on <strong>SUBMIT</strong> button with this 3 field i want to post token from my side.</p>
  
  <p>So how can i post token with this post request and also how can get Response of this request.</p>
  
  <p><em>This is my ajax Function:</em></p>
  
  <pre><code> $("#submit").click(function () {
                     $.ajax({
                         url: 'http://localhost/php_site/insertUserData',
                         method: "POST",
                         dataType: 'json',
                         data: $("#form").serialize(),
                         success: function (result) {
                             console.log(result);
                         },
                         error: function () {
                             console.log("error");
                         }
                     });
                 });
  </code></pre>
  
  <p>Above ajax post request code implemented in php file loaded in Android webview. </p>
  
  <p>I try to find but can't get exact solution please help me if anyone know this. Thank you.</p>