I have absolutely no idea how to do this, so I’m just gonna go ahead and ask.
What I want to do is update the contents of a div with a PHP script I have in an external file, called send.php.
So I have a div like this:
<div class="classname">
</div>
And I want to post data to this send.php file, and then update that div with whatever the outcome of the PHP script is. Can this be done?
For simple ajax calls, I normally prefer using $.load as its grammar is extremely concise. Passing parameters as an object (key/value pairs) will cause it to use a POST request:
If you don’t need it to be a POST, you can just add your parameters as a query string: