I want to send some data using jQuery
var uri = "some url";
$.post(uri,
{ message: "test"},
{"format" : "json"},
'html');
return false;
When the php script gets the request the message field is empty. Why?
Edit: I use zend framework to read the post data
$this->getRequest ()->getPost ( 'message' );
The js code from above workes on localhost but on the server message is empty. I check with isPost() which says that there is no post.
You are passing two objects to
$.post. There’s no reason to do this. I think you just want this:The server will understand the format of the posted data.