• 前端


    1、下拉列表选择生效函数

      

    function changeSessionMarketType(marketType) {
            var params = {marketType:marketType}
            
            $.ajax({
                 type: "POST",
                  url: "./adminHome/changeSessionMarketType.html",
                  data: params,
                  success: function(msg){
                    window.location.reload();
                    alert("切换成功!");
                   }
            });
        }
        
        function changeSessionLanguageType(languageType) {
            var currentUrl = window.location.href;
            if(0 == languageType){
                window.location.href = "./adminHome/main.html?lang=zh_CN";
    /*             if(currentUrl.indexOf("?") != -1){
                    window.location.href = currentUrl + "&lang=zh_CN";
                }else{
                    window.location.href = currentUrl + "?lang=zh_CN";
                } */
            }else if(1 == languageType){
                window.location.href = "./adminHome/main.html?lang=en_US";
    /*             if(currentUrl.indexOf("?") != -1){
                    window.location.href = currentUrl + "&lang=en_US";
                }else{
                    window.location.href = currentUrl + "?lang=en_US";
                } */
            }
        }
    <%
        String role = (String)request.getSession().getAttribute("ROLE");//当前登录用户的权限
        Locale locale = (Locale)request.getSession().getAttribute("LOCALE");//当前登录用户的语言
        Integer marketType = (Integer)request.getSession().getAttribute("marketType");//当前登录用户的APP
        RequestContext requestContext = new RequestContext(request);  
        Locale myLocale = requestContext.getLocale(); 
        String language = myLocale.getLanguage();
    %>
    <div class="account_meta account_language">
                        <spring:message code="language" />:
                        <select id="languageType"
                            onchange="changeSessionLanguageType(this.options[this.options.selectedIndex].value)">
                            <option value="0" <%if(language.contains("zh")){%> selected<% } %>>
                                <spring:message code="language.cn" />
                            </option>
                            <option value="1" <%if(language.contains("en")){%> selected<% } %>>
                                <spring:message code="language.en" />
                            </option>
                        </select>
                        <!-- Locale: ${pageContext.response.locale} -->
                    </div>
                    
                    <div class="account_meta account_language">
                        <spring:message code="switch_app" />: 
                        <select id="marketType"
                            onchange="changeSessionMarketType(this.options[this.options.selectedIndex].value)">
                            <option value="0" <%if(marketType.intValue()==0){%> selected<% } %>>FCA</option>
                            <option value="1" <%if(marketType.intValue()==1){%> selected<% } %>>SCB</option>
                        </select>
                    </div>
    坚持就是胜利
  • 相关阅读:
    Ansi,UTF8,Unicode,ASCII编码的区别
    Delphi 快捷键
    Sql Server2008恢复备份数据库问题
    js图片无缝滚动代码
    SQL Server 2008 清空删除日志文件 130G日志 10秒内变10M .
    JavaScript_循环26个英文字母的方法 .
    iframe跨子域
    sql数据库该名字
    大型网站架构的优化与架构演变(整理) .转自网络
    删除SQL日志语句,经测试8G日志文件都可以删除
  • 原文地址:https://www.cnblogs.com/xiaotieblog/p/8510614.html
Copyright © 2020-2023  润新知