客户端代码,服务器端代码

区分本地js代码和服务端解析后传给本地的代码,,'<s:if test="ss=='+ii+'">'   struts 是服务端解析后传入浏览器 ,ii  是本地js ,不能混合使用, 可运用    局部刷新技术实现局部刷新 ,  也可以全部解析后在使用js  进行帅选 

注意:   js  和jsp 代码解析的顺序 ,  

  var indestryHtmlEr="<s:iterator value='indestryThree'><s:if test='code.substring(0,2)=="+ii+"'><tr><td width='140px' vdd='${code}' onclick='indestryfuzhi(\"${code}\")'   是无法执行的  ,,返回值为空  

function getsanji(ii){
//alert("fd");
$("input:[name=t.industry]").unbind("blur");
var indestryHtmlEr="<s:iterator value='indestryThree'><tr><td width='140px' vdd='${code}' onclick='indestryfuzhi(\"${code}\")' onmouseover='this.style.backgroundColor=\"blue\";indstryunbind();' onmouseout='this.style.backgroundColor=\"#FFF\";instrybund();'>${desc}</td></tr></s:iterator>";
if (navigator.userAgent.indexOf("Firefox")>0) { // Mozilla, Safari, ...
indestryHtmlEr="<div style='background-color:#FFF;position: absolute;top: 439px;left: 405px;140px;height:300px;border:1px solid #ccc;overflow-y: scroll;'><table>"+indestryHtmlEr+"</table></div>";
} else if (navigator.userAgent.indexOf("MSIE")>0) { // IE

indestryHtmlEr="<div style='background-color:#FFF;position: absolute;top: 419px;left: 405px;140px;height:300px;border:1px solid #ccc;overflow-y: scroll;'><table>"+indestryHtmlEr+"</table></div>";
}else {
indestryHtmlEr="<div style='background-color:#FFF;position: absolute;top: 439px;left: 405px;140px;height:300px;border:1px solid #ccc;overflow-y: scroll;'><table>"+indestryHtmlEr+"</table></div>";
}

$("#indestryjiegouSan").html(indestryHtmlEr);
$("#indestryjiegouSan tr td").each(function(){
if($(this).attr("vdd").substr(0,4)!=ii.substr(0,4)){
$(this).parent().remove();
}
});

原文地址:https://www.cnblogs.com/zhangchenglzhao/p/3009999.html