Link to home
Start Free TrialLog in
Avatar of carsRST
carsRSTFlag for United States of America

asked on

JQuery-AJAX- Basic help

Trying to convert ajax calls over to Jquery.  Right now just in experiment mode for learning reasons.


Wanted I'm trying to do is transform the code below to accept returned JSON data and iterate through it (just alert functionality for now).  The click function belongs to an image.  The PHP page returns JSON data.

Or is there a better way in jquery for ajax calls that return JSON data?


                  $('#ok').click(function() {

                              $.ajax({
                                      type: "get",
                                      url: "agents_lookup.php",
                                      data: "term=a",
                                      success: function(msg){
                                          alert(msg );
                                      }
                                    });
                  
                  
                  });
SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of carsRST

ASKER

You guys are great.  

Thanks for the help!