Getting into the swing of AJAX for my next project and I'm a little overwhelmed! I have an order form page, and on the page there are approx 50 users and each of them have a tremendous amount of data. It'd be silly to display all the info straight off the bat because load times etc. So instead, just display a summary of the person and when clicked, use AJAX to pull out their order.
My example so far:
<div class="row bottom-buffer">
<div class="col-sm-2">
$date
</div>
<div class="col-sm-3">
<a href="#" class="person" name="order_no">$name</a>
</div>
<div class="col-sm-2">
$order_status
</div>
<div class="col-sm-3">
$order_date
</div>
<div class="col-sm-2 text-center">
<A href="#" class="person" name="order_no">$order</A>
</div>
</div>
<div class="contactInfo ">
<form action="#" method="post">
//Big a$$ order I want pulled from the DB such as name, order number, order status, notes, payment etc
</form>
</div>
when the link is clicked (class="person") a dropdown will appear displaying the form for that user. The following code I have is:
j$('.person').click(function(e) {
j$(this).closest('.row').next().slideToggle();
});
I have the SQL ready to go, I just don't know how to AJAX to call my PHP file. Do I do the AJAX call in the .click function? Any help would be greatly appreciated!