0
안녕하세요, jsp 변수 값을 자바 스크립트에서 사용하고 싶습니다. 어떻게 사용할 수 있습니까?자바 스크립트에서 jsp 문자열 변수 값을 전달하는 방법
여기 내 코드입니다.
Demo.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String plane="A";
%>
<script>
var planB=<%=plane%>;
c
if(planB==B){
document.write("shakti");
}else{
document.write("sharma");
}
</script>
</body>
</html>
는 어떻게 원하는 출력 얻을 수
시도'var planB = '<%=plane%>'; ' – A4L
나는 작동하지 않았다. – user3598351