0

请帮我为我的应用程序修复这个脚本,我正在尝试让链选择工作。该脚本基本上从下拉列表中检查选定的下拉值并在数据库中搜索该值

JS:

<Script type="text/javascript">
    $("#propinsi_id").change(function () {
        var propinsi_id = {
            propinsi_id: $("#propinsi_id").val()
        };
        $.Ajax({
            type: "POST",
            url: "<?php echo SITE_URL('Repair/select_fault')?>",
            Data: propinsi_id,
            success: function (msg) {
                $('#city').html(msg);
            }
        });
    });
</Script>

错误:

I caught this error 

Uncaught TypeError: Object
function (selector, context) {
    //The jQuery object is actually just the init constructor 'enhanced'
    return new jQuery.fn.init(selector, context, rootjQuery);
}
has no method 'Ajax'
4

2 回答 2

0

这个

$.Ajax({

需要小写

$.ajax({

我也会Data:改为data:

于 2013-09-02T09:25:05.657 回答
0

尝试这个

<script type = "text/javascript" >
  $("#propinsi_id").change(function(){
                var  propinsi_id = {propinsi_id:$("#propinsi_id").val()};
                $.ajax({ //<---here
                        type: "POST" ,
                        url: "<?php echo SITE_URL('Repair/select_fault')?>" ,
                        data:propinsi_id, //<---here
                        success:function(msg) {
                            $('#city').html(msg);
                        }
                    });
        });

 </script>
于 2013-09-02T09:25:32.760 回答