How can i pass POST [] array to jquery.
Am using the code.

var test = $("#content").val();
var dataString = 'content='+ test;

if(test=='')
{
alert("Please Enter Some Text");
}
else
{
$("#flash").show();
$("#flash").fadeIn(400).html('<img src="ajax-loader.gif" align="absmiddle"> <span class="loading">Loading Comment...</span>');

$.ajax({
type: "POST",
url: "demo_insert.php",
data: dataString,
cache: false,


Here only one variable ,"content " is passing .
With out declaring each post variable is it possible to pass the POST array

So you want to reply to send back to AJAX the exact content that AJAX sent through post? That seems kind of pointless to me, unless you want to do something to the data first (like search for it in a DB). In that case do this:

demo_insert.php:

//Use the POST value you sent up with $_POST['content']
//Send data back to JQuery with echo
echo "Hello JQuery!";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.