Javascript 从JQuery中的url获取数据选择器区域

Javascript 从JQuery中的url获取数据选择器区域,javascript,jquery,datepicker,Javascript,Jquery,Datepicker,我有一段来自互联网的JQuery代码: $.datepicker.setDefaults($.datepicker.regional["${lang}"]); $("#dateinput").datepicker({ dateFormat: "yy-mm-dd", beforeShowDay: beforeShowDayHandler,

我有一段来自互联网的JQuery代码:

 $.datepicker.setDefaults($.datepicker.regional["${lang}"]);

                     $("#dateinput").datepicker({
                            dateFormat: "yy-mm-dd",
                            beforeShowDay: beforeShowDayHandler,
                            showOn: 'both',
                            onClose: function (dateText, inst) {
                                $(this).attr("disabled", false);
                            },
                            beforeShow: function (input, inst) {
                                $(this).attr("disabled", true);
                            }

                        });

                        function beforeShowDayHandler(date) {
                            if (self.SelectedDayValue != -1) {
                                if (date.getDate() != 1) {
                                    return [false, '', 'selected'];
                                }
                            }
                            return [true, ''];
                        }
在第一个字符串中,我试图从url字段获取区域。看来它不起作用了?每次我都有英语课。url是:
http://localhost:8080/web/input?lang=ru
。所以我想买俄罗斯的。有人能帮我解决这个问题吗

url防御中的My lang参数:

<beans:bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
             <beans:property name="paramName" value="lang"/>
        </beans:bean>

和JSP页面:

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <spring:message code="label.input.head" var="headTitle"/>
    <title>${headTitle}</title>

    <script type="text/javascript" src="resources/jsFiles/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="resources/jsFiles/select2.js"></script>
    <link rel="stylesheet" href="resources/cssFiles/select2.css"/>
    <script type="text/javascript" src="resources/jsFiles/select2_e.js"></script>
    <link rel="stylesheet" href="resources/cssFiles/inputStyle.css"/>

    <script type="text/javascript" src="resources/jsFiles/jquery-ui.js"></script>
    <script type="text/javascript" src="resources/jsFiles/jquery-ui-i18n.js"></script>
    <link rel="stylesheet" href="resources/cssFiles/jquery-ui.css"/>

        <script type="text/javascript">

                 $(document).ready(function() {

                     $.datepicker.setDefaults($.datepicker.regional["${lang}"]);

                     $("#dateinput").datepicker({
                            dateFormat: "yy-mm-dd",
                            beforeShowDay: beforeShowDayHandler,
                            showOn: 'both',
                            onClose: function (dateText, inst) {
                                $(this).attr("disabled", false);
                            },
                            beforeShow: function (input, inst) {
                                $(this).attr("disabled", true);
                            }

                        });

                        function beforeShowDayHandler(date) {
                            if (self.SelectedDayValue != -1) {
                                if (date.getDate() != 1) {
                                    return [false, '', 'selected'];
                                }
                            }
                            return [true, ''];
                        }

                         jQuery(function ($) {
                                console.log($('.widthclass').select2_e().on('change', function () {
                                    alert(this.value);

                                }));
                            });              

                         });
             </script>

</head>


<body>

    <spring:message code="label.input.button" var="save"/>

    <table align="left">
        <tr> <td> Language/Язык/文 : <a href="input?lang=en">English</a>||<a href="input?lang=ru">Русский</a>||<a href="input?lang=cn">中文</a> </td> </tr>
    </table>

    <table align="right">
        <tr> <td> <a href="j_spring_security_logout"> <spring:message code="label.login.logout" /> </a> </td> </tr>
    </table>

    <br/>

    <table align="center">
        <tr><td width="620"> <h3 align="left"><spring:message code="label.input.topLabel"/></h3> </td></tr>
    </table>    

 <form:form modelAttribute="fboiAttributes" action="add" method="post">  

    <table align="center"  style="border-bottom-style:inset; border-top-style: outset;">

    <tr><td align="right"> <form:label path="formDescription.kidsGoSchoolDate"> <spring:message code="label.input.childGoSchoolDate"/> </form:label> </td> <td> <form:input id="dateinput" path="formDescription.kidsGoSchoolDate"/> </td> <td><b><font color="#FF0000"><form:errors path="formDescription.kidsGoSchoolDate"/></font></b></td> </tr>


    <tr><td> <input type="submit" value="${save}"/> </td> <td align="right">  </td> </tr> 

   </table>

 </form:form>

${headTitle}
$(文档).ready(函数(){
$.datepicker.setDefaults($.datepicker.regional[“${lang}]”);
$(“#dateinput”).datepicker({
日期格式:“年月日”,
beforeShowDay:beforeShowDayHandler,
showOn:“两者都有”,
onClose:函数(dateText,inst){
$(this.attr(“已禁用”,false);
},
显示前:功能(输入、安装){
$(this.attr(“disabled”,true);
}
});
函数beforeShowDayHandler(日期){
如果(self.SelectedDayValue!=-1){
如果(date.getDate()!=1){
返回[false],“selected”];
}
}
返回[true',];
}
jQuery(函数($){
console.log($('.widthclass')。在('change',function()上选择2_e(){
警报(该值);
}));
});              
});
语言/文 : ||||  


谢谢大家。

你们如何定义
${lang}
?你能把代码也显示出来吗?您的语言是否也包含jQuery datepicker区域js文件?是否也可以添加相应的HTML?或者更好的是一杯鸡尾酒什么的?是的,先生。我希望你需要的东西我都加了。我使用Spring和JSP