軟件藝術(shù)思考者  
          混沌,彷徨,立志,蓄勢...
          公告
          日歷
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          導(dǎo)航

          隨筆分類(86)

          隨筆檔案(85)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

           

          1.js StringUtil
          它是標準的base64編碼,解碼.

          var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
          var base64DecodeChars = new Array(
              -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
              -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
              -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
              52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
              -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
              15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
              -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
              41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
          //客戶端Base64編碼
          function base64encode(str) {
              var out, i, len;
              var c1, c2, c3;

              len = str.length;
              i = 0;
              out = "";
              while(i < len) {
           c1 = str.charCodeAt(i++) & 0xff;
           if(i == len)
           {
               out += base64EncodeChars.charAt(c1 >> 2);
               out += base64EncodeChars.charAt((c1 & 0x3) << 4);
               out += "==";
               break;
           }
           c2 = str.charCodeAt(i++);
           if(i == len)
           {
               out += base64EncodeChars.charAt(c1 >> 2);
               out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
               out += base64EncodeChars.charAt((c2 & 0xF) << 2);
               out += "=";
               break;
           }
           c3 = str.charCodeAt(i++);
           out += base64EncodeChars.charAt(c1 >> 2);
           out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
           out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
           out += base64EncodeChars.charAt(c3 & 0x3F);
              }
              return out;
          }

           

          //客戶端Base64解碼
          function base64decode(str) {
              var c1, c2, c3, c4;
              var i, len, out;

              len = str.length;
              i = 0;
              out = "";
              while(i < len) {
           /* c1 */
           do {
               c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
           } while(i < len && c1 == -1);
           if(c1 == -1)
               break;

           /* c2 */
           do {
               c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
           } while(i < len && c2 == -1);
           if(c2 == -1)
               break;

           out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));

           /* c3 */
           do {
               c3 = str.charCodeAt(i++) & 0xff;
               if(c3 == 61)
            return out;
               c3 = base64DecodeChars[c3];
           } while(i < len && c3 == -1);
           if(c3 == -1)
               break;

           out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));

           /* c4 */
           do {
               c4 = str.charCodeAt(i++) & 0xff;
               if(c4 == 61)
            return out;
               c4 = base64DecodeChars[c4];
           } while(i < len && c4 == -1);
           if(c4 == -1)
               break;
           out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
              }
              return out;
          }

           2.使用。

          <script>

          function writeCookie_bak(name, value, hours)
          {
            var expire = "";
            if(hours != null)
            {
              expire = new Date((new Date()).getTime() + hours * 3600000);
              expire = "; expires=" + expire.toGMTString();
            }
            document.cookie = name + "=" + escape(value) + expire+";path=/movo/";
          }

          function readCookie_bak(name)
          {
            var cookieValue = "";
            var search = name + "=";
            if(document.cookie.length > 0)
            {
              offset = document.cookie.indexOf(search);
              if (offset != -1)
              {
                offset += search.length;
                end = document.cookie.indexOf(";", offset);
                if (end == -1) end = document.cookie.length;
                cookieValue = unescape(document.cookie.substring(offset, end))
              }
            }
            return cookieValue;
          }

           var blogerNick = readCookie_bak('blogerNick');
               alert("blogerNick::"+base64decode(blogerNick));

          </script>

          2.

          <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
          <%@ taglib uri="/webwork" prefix="ww"%>
          <%@ taglib uri="/compass" prefix="compass"%>
          <%@taglib uri="/jstl/c" prefix="c"%>
          <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
          <%
          String contextPath = request.getContextPath();
          %>
           <%--<meta http-equiv="pragma" content="no-cache">
           <meta http-equiv="cache-control" content="no-cache">
           <meta http-equiv="expires" content="0">    --%>
           <meta name="keywords" content="夜店,酒吧,夜店網(wǎng)站,夜店視頻,跨語平臺,夜店生活,夜店美女"/>
              <meta name="description" content="什么是夜店,北京夜店,夜店美女,酒吧,全球跨語種夜店,夜店酒吧,北京后海酒吧,三里屯酒吧,后海酒吧"/>
           <%--<%  response.setHeader("Pragma","No-cache"); 
            response.setHeader("Cache-Control","no-cache"); 
            response.setDateHeader("Expires", 0);
           %>--%>
          <script language="javascript" src="<%=contextPath %>/js/jquery.js"></script>
          <script type="text/javascript" SRC="<%=contextPath %>/js/store.js"></script>
          <script type="text/JavaScript" src="<%=contextPath%>/js/compassReg.js"></script>
          <script type="text/javascript">
          function login_head(contextPath){
            var email       = document.getElementById('email_head');
            var psw         = document.getElementById('passWord1_head');
            
            $.ajax({
             type : "POST",
             data : "email="+email.value+"&passWord="+psw.value,
             url  : contextPath + "/index!login.do",
             success : function (resMsg) {
              if (resMsg.indexOf("success") != -1) {
                  var msg = resMsg.split(":");
                  alert("登陸成功");
               window.location.reload();
                  document.getElementById("login_head").innerHTML= msg[1];
               
              var loginafter= document.getElementById("login_head");
                  loginafter.innerHTML="<span style='color:#ffffff'>歡迎您:"+email.value+"</span>";
                  loginafter.style.display="block";
               //loginbbs();
               //$("#in a")
               
              } else {   
               alert('用戶名或密碼錯誤');
              }
             }   
            });
           } 
          function changeLanguage(language){

            $.ajax({
                      type: "GET",
                      data: "currentLanguage="+language,
                      url: "<%=contextPath%>" + "/base!changeLanguageForYeDian.do",
                      success: function(res){
              window.location.reload(); 
                      }
                  });
                  }
              function bookmarkSite(title, url)
          {
              if (document.all)
              window.external.AddFavorite(url, title);
              else if (window.sidebar)
              window.sidebar.addPanel(title, url, "")
          }
          </script>

          <!-- top -->
          <div id="header" class="heasssder mainwidth">
            <div class="left"><A ><IMG class=left src="images/clubfun_01.gif"></A><A target="_blank"><IMG class=left src="images/clubfun_02.gif"></A></div>
            <div class="logoright right">
              <ul class="logorighttop">
                <li style="margin-right:5px;"><a href="javascript:bookmarkSite('movo','http://www.movo.tv')"><ww:text name="yhead.shoucangbenzhan">收藏本站</ww:text></a></li>
                <li class="language"><a name="lan" href="<%=contextPath%>/base!changeLanguage.do?currentLanguage=zh&reqUrl="><img src="http://images.movo.tv/clubfun/images/zh.gif" alt="" /></a>
                <a name="lan" href="<%=contextPath%>/base!changeLanguage.do?currentLanguage=en&reqUrl="><img src="http://images.movo.tv/clubfun/images/en.gif" alt="" /></a>
                <a name="lan" href="<%=contextPath%>/base!changeLanguage.do?currentLanguage=ko&reqUrl="><img src="http://images.movo.tv/clubfun/images/ko.gif" alt="" /></a>
                <a name="lan" href="<%=contextPath%>/base!changeLanguage.do?currentLanguage=ja&reqUrl="><img src="http://images.movo.tv/clubfun/images/ja.gif" alt="" /></a></li>
              </ul>
              <ul class="clear"></ul>
              <ul class="logorightbottom">
               <li>
               <ww:if test="${sessionsuser==null}"><span id="pleaselogin_head"></span>
               <a href="<%=contextPath %>/redianreg!reg.do"><ww:text name="yhead.mashang">馬上注冊</ww:text></a></ww:if>
               <ww:else>
               <ww:if test="${sessionsuser.type==3 &&sessioncompass.status==1}"><a href="<%=contextPath %>/huodong!dianZhuIndex.do">店主管理</a></ww:if>
               <ww:else><a href="<%=contextPath %>/huodong!geRenIndex.do">個人夜店管理</a></ww:else>
               </ww:else>
               <a href="<%=contextPath %>/redianreg!resetPassword.do"><ww:text name="yhead.wangji">忘記密碼?</ww:text></a></li>
              </ul>
            </div>
            <div class="clear"></div>
          </div>
          <!-- End top -->
          <!-- Nav -->
          <div id="nav" class="nav mainwidth">
            <div class="navlist left">
              <ul>
                <li  class="lihove"><a href="<%=contextPath %>/ystore!index.do" style="cursor: pointer;"><span><ww:text name="yhead.shouye">首頁</ww:text></span></a></li>
                <li><a href="<%=contextPath %>/ystore!allStores.do"><span><ww:text name="yhead.yedian">夜店</ww:text></span></a></li>
                <li><a href="<%=contextPath %>/huodong1!allManageActivate.do"><span><ww:text name="yhead.huodong">活動</ww:text></span></a></li>
                <li><a href="<%=contextPath %>/ystore!photosets.do?photosetType=3"><span><ww:text name="yhead.xiangce">相冊</ww:text></span></a></li>
                <li><a href="<%=contextPath %>/huodong1!videosInit.do"><span><ww:text name="yhead.shipin">視頻</ww:text></span></a></li>
              </ul>
            </div>
            <ww:if test="${ empty sessionsuser }">
            <div class="login right" id="login_head">
              <ul>
             
                <li class="loginid"><input type="text"id="email_head" name="textfield" /></li>
                <li class="loginpw"><input type="password"id="passWord1_head" name="textfield2" /></li>
                <li class="loginsub"><input type="submit" name="Submit" value='<ww:text name="yhead.denglu">登錄</ww:text>' onclick="login_head('<%=contextPath %>');"/></li>
              </ul>
            </div>
           </ww:if> <ww:else>
           <div class="login right" id="login_head">
             <ul>
              <li class="login"style="color:#ffffff"><ww:text name="yhead.nihao">你好:</ww:text>${sessionsuser.nickName }||<a href="javascript:loginout('<%=contextPath %>');"><font color="#FFFFFF">安全退出</font></a></li>
              </ul>
                </div>
           </ww:else>
            <div class="clear"></div>
          </div>
          <!-- End Nav -->
          <!-- Search -->
          <div id="search" class="search mainwidth mainbottom">
            <div class="searchkeyword right"><ww:text name="yhead.guanjianci">關(guān)鍵詞:</ww:text><c:forEach items="${guanJianciList}" var="guanjianci"><a href="${guanjianci.YRecommend.detailUrl }">${guanjianci.keycontext }</a></c:forEach></div>
            <div class="searchlogin">
              <form id="form11" name="form11" method="post" action="<%=contextPath %>/huodong1!searchInit.do">
                <input type="text" name="searchName" class="searchinputkey" />
                <select name="searchType" class="searchinputqy">
                  <option value="1"><ww:text name="yhead.yedian">夜店</ww:text></option>
                  <option value="2"><ww:text name="yhead.huodong">活動</ww:text></option>
                  <option value="3"><ww:text name="yhead.xiangce">相冊</ww:text></option>
                </select>
                <input type="submit" name="Submit" value='<ww:text name="yhead.tijiao">提交</ww:text>' class="button" />
              </form>
            </div>
          </div>
          <div class="clear"></div>
          <script type="text/javascript">
            var lans = document.getElementsByName("lan");
              for(var i=0 ; i < lans.length; i++){
               lans[i].href = lans[i].href + location.href.replace(/\&/g,'|');
              }
          </script>
          <!--

          //-->
          </script>
          <!-- End Search -->

           

          posted on 2008-08-20 19:49 智者無疆 閱讀(509) 評論(0)  編輯  收藏 所屬分類: about java
           
          Copyright © 智者無疆 Powered by: 博客園 模板提供:滬江博客


             觀音菩薩贊

          主站蜘蛛池模板: 稷山县| 固安县| 桦南县| 资兴市| 定兴县| 南岸区| 武邑县| 扬州市| 灌南县| 绩溪县| 海丰县| 南充市| 育儿| 闸北区| 广灵县| 西乌珠穆沁旗| 安吉县| 石家庄市| 石河子市| 罗定市| 樟树市| 玛纳斯县| 项城市| 乐平市| 黄龙县| 潜山县| 托里县| 昆山市| 南澳县| 西吉县| 滕州市| 比如县| 彩票| 衢州市| 商水县| 万盛区| 波密县| 香河县| 深泽县| 新密市| 上栗县|