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