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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 宇视监控服务器无法登录
    • ¥15 PADS Logic 原理图
    • ¥15 PADS Logic 图标
    • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
    • ¥20 气象站点数据求取中~
    • ¥15 如何获取APP内弹出的网址链接
    • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
    • ¥50 STM32单片机传感器读取错误
    • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
    • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)