Can I pass form values in load() function开发者_StackOverflow of jQuery then be able to read them as $_POST parameters in php? ...
Sure, add an object with the values as 2nd parameter to your load call. See the docs where is stated:
The POST method is used if data is provided as an object; otherwise, GET is assumed.
So your JavaScript could look like:
$('#result').load('ajax/call.php', { postVarName: 'value' }, function() {
alert('Load was performed.');
});
In PHP you can now access it:
echo $_POST["postVarName"]; // will echo: value
精彩评论