• 缓存


    // 缓存中数据赋值
    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);

  • 相关阅读:
    zabbix邮件报警
    简单的带权随机算法
    一、向量
    C#遍历DataSet
    旅游(二)——广州
    旅游(一)——潮州
    LoRa术语
    Linux基础(一)
    Git(二)_基本命令
    Git使用(一)——Cygwin
  • 原文地址:https://www.cnblogs.com/konglxblog/p/10012051.html
Copyright © 2020-2023  润新知