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

WBOY
Release: 2016-06-02 11:31:55
Original
1491 people have browsed it

php回调jquery

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

<code> 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 = "<option value='"+array[' bus_price>"                        + array['bus_terminal'] + "</option>";                ds_id.append(option);            });        });    }    //下面是页面加载时自动执行一次getVal()函数     $().ready(function() {        getVal();        $("#sf_id").change(function() {//省份部分有变动时,执行getVal()函数             getVal();            //$("option", ds_id).remove(); //清空原有的选项,也可使用 ds_id.empty();         });    });</code>
Copy after login

请教各位大神指教

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template