Try the following code. It sends the request with item1 set to "value1", and
assumes that the returned data will contain a value named 'return1'.
In the response function you can check the returned data and submit a new
response if required.
// send data:
$.ajax({"type": "POST",
"url": "foo.php",
"data": {"item1": "value1"},
"dataType": "json",
"success": on_ajax_response});
// called on successful response
function on_ajax_response(json)
{
alert('return value: ' + json.return1);
}
rob.
On 4/26/07, amircx <[EMAIL PROTECTED]> wrote:
hey
i got a script that returns me on submit ajax json data... somthing like
{status:1,data: loading secound script}
how can i do a script that waits to data to be back and then execute
another
script?
user submit>proccessing data from another php page>return results (if its
status 1 - then run a secound php script ...}
--
View this message in context:
http://www.nabble.com/fire-script-on-return-values..-how--tf3651533s15494.html#a10200072
Sent from the JQuery mailing list archive at Nabble.com.
--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.