Getting image href with ajax
I have the tiny carousel plugin and I want to create a new select box when the user click one of the images in tiny carousel. I want to get the href and the select box should load automatically each time the user click a new image. Here is my code so far:
Ajax (default.js)
- $(".overview").click(function(){
- var overview=$(".overview").val();
- $.ajax({
- type:"post",
- url:"../../data/course.php",
- data:"overview="+overview,
- success:function(data){
- $("#courses").html(data);
- }
- });
- });
course.php
- <?php
- include $_SERVER['DOCUMENT_ROOT'] . "/inc/connect.inc.php";
- $slider1=$_POST["overview"];
- echo $slider1;
- $result=mysql_query("SELECT * FROM courses WHERE organization='$slider1' ");
- echo '<option value = "">-Sciegli-</option>';
- while($fetch=mysql_fetch_array($result)){
- echo "<option value=$fetch[id]>$fetch[name]</option>";
- }
- ?>
The click event works, but the $slider1 doesn't get any value. So basically I don't know how to get the href and add the value to $_POST['overview'];