从ajax获取值到php

I have a problem on getting value from drop down on changing the option from html form to php variable.And then here i have change the second drop down option based upon first drop down.I want to get value of first drop down on change in php variable.....thanks in advance

This is my JS Coding

<script type="text/javascript">
        function select_area(area_id){
        if(area_id!="-1"){
        load_data('layout',area_id);
        }else{
        $("#layout_dropdown").html("<option value='-1'>---Select Area First---</option>");
        }
        }

        function load_data(load_type,load_id){
        var dataString='load_type='+load_type+'&load_id='+load_id;
        $.ajax({
        type: "POST",
        url: "load2.php",
        data: dataString,
        cache: false,
        success: function(result){

        $("#"+load_type+"_dropdown").html("<option value='-1'>Select "+load_type+"</option>");
        $("#"+load_type+"_dropdown").append(result);
        }
        });

        }


    </script>

And this is my HTML Form Coding,

<tr>
<td width="120"><strong>Select Area Name</strong></td>
<td><select id="area_dropdown" onChange="select_area(this.options[this.selectedIndex].value)" name="area" style="width:150px"><option value="-1">----Select Area----</option>
<?php                                           while($row_area=mysql_fetch_array($res_area))
{
?>
<option value=<?php echo $row_area['a_id'];?>><?php echo ucwords($row_area['a_name']);?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td width="120"><strong>Select Layout Name</strong></td>
<td><select id="layout_dropdown"name="layout" style="width:150px">
<option value="-1">---Select Layout---</option>
</select>
</td>
<td>
<input type="submit" value="Find"/>
<?php echo $_POST['area'];print_r($Data);   ?>
</td>
</tr> 

Try the following :

function load_data(load_type,load_id) {
    $.ajax({
        type: "POST",
        url: "load2.php",
        data: {
            'load_type': load_type,
            'load_id': load_id
        },
        cache: false,
        success: function(result) {
            if(result.length > 0)
                $("#"+load_type+"_dropdown").html("<option value='-1'>Select "+load_type+"</option>"+result);
        }
    });
}

$(document).ready(function() {
    $("#area_dropdown").change(function() {
        var id = parseInt($(this).val());

        if(id != -1) {
            load_data('layout',id);
        }
    });
});

And remove onChange property from :

<select id="area_dropdown" onChange=

n PHP, you can't simply return your value and have it show up in the ajax response. you need to print or echo your final values. (there are other ways too, but that's getting off topic).

also, you have a trailing apostrophe in your alert() call that will cause an error and should be removed.

Fixed:

$.ajax({
    type: 'get',
    url: '/donation/junk/4',
    data: datastring,
    success: function(data) {
        alert(data);
    }
});

PHP:

function junk($id)
{
    print "works11";
}