The PHP dwt write jquery does not perform callbacks, HTML can execute callbacks, ask the great gods to teach.

Source: Internet
Author: User
Keywords PHP callback jquery
PHP callback jquery

Template file dwt wrote the following JS code, why there is no callback, written in the HTML can be recalled

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

Ask the great God to teach you

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.