当前位置:Gxlcms > PHP教程 > phpdwt写的jquery不执行回调,html可以执行回调,请大神们指教。

phpdwt写的jquery不执行回调,html可以执行回调,请大神们指教。

时间:2021-07-01 10:21:17 帮助过:29人阅读

php回调jquery

模版文件dwt 写了如下js代码,为什么没有回调,写在html 里就可以回调

 function getVal() {        $.getJSON("bus_sel.php", {            sf_id : $("#sf_id").val()        }, function(json) {            alert(1111);            var ds_id = $("#ds_id");            $.each(json, function(index, array) {            alert("dddddd");                var option = "";                ds_id.append(option);            });        });    }    //下面是页面加载时自动执行一次getVal()函数     $().ready(function() {        getVal();        $("#sf_id").change(function() {//省份部分有变动时,执行getVal()函数             getVal();            //$("option", ds_id).remove(); //清空原有的选项,也可使用 ds_id.empty();         });    });

请教各位大神指教

人气教程排行