I'm completely confused with the data
transferred by a jQuery-AJAX
(specifically I've been using $.post
mostly)
I've had a few attempts at transferring data to/from a PHP page and I'm left unsure what to use when, and how.
I've seen it done in a bunch of ways:
var dataString = 'username='+ username + '&userpassword=' + password;
var dataString = '<?php echo $someVariable ?>';
I've seen it done with serialize()
, json_encode
, stringify
, sometimes nothing at all. I find this very confusing, how do I know which to use, when and how? And most importantly, what tutorial/guide can I read to understand this thoroughly?