碰到一个问题需要再js中根据jsp中request的参数判断执行那段代码

第一种写法:

if('${method}'=="add"){js代码段1}else{js代码段2}

第二种写法:

 <%if(request.getAttribute("method")!= null&&request.getAttribute("method").equals("add")){%>

         js代码段1
 <%}else{%>
         js代码段2
  <%}%>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-10-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-12-30
  • 2021-06-03
相关资源
相似解决方案