weixin_33670786 2016-06-22 06:44 采纳率: 0%
浏览 19

获取有关ajax的以前的下拉列表

I want to get the value from previous drop down value, i use this below code to get the value but it seems doesn't works.

Value 1

$(document).ready(function () { 
        $('#notification_id select').change(function () {
            var selLang = $(this).val();
            console.log(selLang);
            $.ajax({   
                url: "<?php echo base_url(); ?>/Bnotifications/ajax_notif_languange", 
                async: false,
                type: "POST", 
                data: "notification_lang="+selLang, 
                dataType: "html", 
                beforeSend: function(data) {
                            $('#notiflang').html('<img src="<?php echo base_url(); ?>/template/images/loader.gif" alt="" width="24" height="24">');
                        },                        
                success: function(data) {

                    $('#notiflang').html(data);

                },
            })
        });
    });

ajax that i want to get the value

$(document).ready(function () { 
        $('body').on('change','#notiftitle select',function () {
            var selTitle = $(this).val();
            var selLang = $("#notiflang").val();
            console.log(selTitle);
            $.ajax({   
                url: "<?php echo base_url(); ?>/Bnotifications/ajax_notif_message", 
                async: false,
                type: "POST", 
                data: "notification_title="+selTitle+'&notification_lang='+selLang, 
                dataType: "html", 
                beforeSend: function(data) {
                            $('#notification_message').html('<img src="<?php echo base_url(); ?>/template/images/loader.gif" alt="" width="24" height="24">');
                        },                        
                success: function(data) {

                    $('#notification_message').html(data);

                },
            })
        });
    });

i use this value and put on code above, but it seems not getting the value from value 1, how to get the value from previous ajax dropdown.

var selLang = $("#notiflang").val();
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 双层网络上信息-疾病传播
    • ¥50 paddlepaddle pinn
    • ¥20 idea运行测试代码报错问题
    • ¥15 网络监控:网络故障告警通知
    • ¥15 django项目运行报编码错误
    • ¥15 请问这个是什么意思?
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样