Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

You can implement simply code can get processed result by jQuery in javascript/HTML5


Code Block
languagejs
titlehttp://qsok.com/demo/js/jQuery/post/
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<script>
var g_acode = "";
function sendAuthKeygetResult()
{
    var fd = new FormData();
    fd.append("name", "Chun Kang"document.MainFrm.uname.value);
    jQuery.ajax({
        url: "/ajax.php",
        type: "post",
        data: fd,
        contentType: false,
        processData: false,
        async: false,
        success: function(response)
        {
            alert(response);
        }
    });
}
</script>

<form method=post name=MainFrm>
    <table>
    <tr>
        <td>Name <input type=text name="uname" value="Chun Kang"></td>
        <td><input type=button value="Get Result" onClick="javascript:getResult();"></td>
    </tr>
    </table>
</form>


Code Block
languagephp
titleajax.php
<?php

extract( $_POST);

echo "Hey {$name}, howdy?";

?>

...