retrieving variables with jquery ajax
Posted
by vick
on Stack Overflow
See other posts from Stack Overflow
or by vick
Published on 2010-04-26T19:43:19Z
Indexed on
2010/04/26
19:53 UTC
Read the original article
Hit count: 149
jQuery
<div class="lead_detail_box_routing">
<div class="lead_detail_box_left">location 1</div>
<div class="lead_detail_box_right">Route</div>
<div class="lead_detail_box_left">location 2</div>
<div class="lead_detail_box_right">Route</div>
<div class="lead_detail_box_left">location 3</div>
<div class="lead_detail_box_right">Route</div>
<div class="lead_detail_box_left">location 4</div>
<div class="lead_detail_box_right">Route</div>
<div id="results" style="text-align:center;"></div>
</div> <!-- end lead_detail and routing-->
e.g. when user clicks on "route" I want my jquery-manual-routing.php to get the "3" ..
so far I have:
<script type="text/javascript">
$(document).ready(function() {
$("a#route").click(function() {
$("#results").load( "jquery-manual-routing.php", { route_to: ???? } );
return false;
});
});
</script>
so in my php script, when the user clicks on route
next to location 3
I want to be able to grab $_GET['route_to'] =3;
Also note that my table already has the class assigned since I am using css to style it
The answer will be pure php echo
© Stack Overflow or respective owner