Hi All,
In a nutshell, I have a form, which upon submissions, sends data to a serverside script to process a function, return data in JSON format for me to parse and spit back out onto the page.
jQuery sends data to "createUser.php" via the
$.post
method$("#create_submit").click(function(){ $.post("/createUser.php", { create_user_name: $('#create_user_name').val(), create_user_email: $('#create_user_email').val(), create_user_password: $('#create_user_password').val() }, function(data){ alert(data.response); }, "json"); });
"createUser.php" returns JSON data
<?php header('Content-type: application/json'); $return['response'] = 'hmm...'; echo json_encode($return); exit; ?>
Maybe it's me, but I can't seem to get the alert that I need. What's going on!?