zoukankan      html  css  js  c++  java
  • 缓存

    // 缓存中数据赋值
    if(localStorage.zzkccbtqjwyj != null && localStorage.zzkccbtqjwyj != ''){

    var str = localStorage.zzkccbtqjwyj.split("&");
    $.each(str,function(i,n){

    var str1 = n.split("=");


    if($("input[name=""+str1[0]+""]")[0]){

    if(str1[0].startsWith("RESULT")){
    var val = str1[1];
    if(val==1){// 不同意

    $($("input[name=""+str1[0]+""]")[1]).attr("checked",true);
    // 不同意checked
    }else{// 同意
    $($("input[name=""+str1[0]+""]")[0]).attr("checked",true);// 同意
    }

    }

    if($("input[name=""+str1[0]+""]").val()== null || $("input[name=""+str1[0]+""]").val() ==""){

    $("input[name=""+str1[0]+""]").val(str1[1]);
    }

    }else if($("textarea[name=""+str1[0]+""]")[0]){
    if($("textarea[name=""+str1[0]+""]").val() == null || $("textarea[name=""+str1[0]+""]").val() == ""){

    $("textarea[name=""+str1[0]+""]").val(str1[1]);
    }

    }

    else if($("select[name=""+str1[0]+""]")[0]){
    if($("select[name=""+str1[0]+""]").val() == null || $("select[name=""+str1[0]+""]").val() == ""){

    $("select[name=""+str1[0]+""]").val(str1[1]);
    }
    }

    /================iframe缓存赋值=======================================/先清空之前的缓存,在保存最新的内容
    var mztj = localStorage.mztj;
    if(mztj!= null && mztj !=""){
    localStorage.mztj = null;
    }
    // 缓存数据
    localStorage.mztj=decodeURIComponent($("form").serialize(),true);


    });
    }

    ================jsp缓存赋值=======================================

    //初步听取纪委意见、了解个人及家庭基本情况
    var iframeBox1_iframe = document.getElementById('iframeBox1').contentWindow;
    var iframeBox1_div =iframeBox1_iframe.document.getElementById('inputForm');
    // 缓存数据
    localStorage.zzkccbtqjwyj=decodeURIComponent($(iframeBox1_div).serialize(),true);

  • 相关阅读:
    .NET Framework 1.13.5 版本安装包下载链接
    可遇不可求的Question之MYSQL获取自增ID的四种方法篇
    20110917 晴
    北海道 7天6夜 自助游
    想你了
    猫忘带电话了
    [转载经验] 探亲签证申请
    帮忙打印
    打印机
    20110910 晴
  • 原文地址:https://www.cnblogs.com/konglxblog/p/10012051.html
Copyright © 2011-2022 走看看