HighDots Forums  

$.ajax and responsed value...

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss $.ajax and responsed value... in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lord Gustavo Miguel Angel
 
Posts: n/a

Default $.ajax and responsed value... - 11-07-2009 , 08:40 AM






Hi,
I need transfer from resultados.php two values, to next check and run something.
Example code:

Code run when i clicked in button of form

var sData = 'name' + "gerardo" + '&password' + '123';

$.ajax({
type: "POST",
url: '../resultados.php',
data: sData,
success: function(values){
/*
There i need check:
if values[1] then{
echo "all ok"
} else{
echo "error".
}
*/
}
});


-------8<---------------
resultados.php

<?php
$a= $_POST["name"];
$b=$_POST['password'];
echo $a;
echo $b;
?>

Thank´s

Reply With Quote
  #2  
Old   
Josip Lazic
 
Posts: n/a

Default Re: $.ajax and responsed value... - 11-07-2009 , 02:02 PM






You could try return json encoded data from PHP, here's tutorial
http://www.prodevtips.com/2008/08/15/jquery-json-with-php-json_encode-and-json_decode/

Reply With Quote
  #3  
Old   
Lord Gustavo Miguel Angel
 
Posts: n/a

Default Re: [jQuery] Re: $.ajax and responsed value... - 11-07-2009 , 02:19 PM



thank´s

--------------------------------------------------
From: "Josip Lazic" <jlazic4 (AT) gmail (DOT) com>
Sent: Saturday, November 07, 2009 4:02 PM
To: "jQuery (English)" <jquery-en (AT) googlegroups (DOT) com>
Subject: [jQuery] Re: $.ajax and responsed value...

Quote:
You could try return json encoded data from PHP, here's tutorial
http://www.prodevtips.com/2008/08/15/jquery-json-with-php-json_encode-and-json_decode/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.