请问怎么在javascript中调用服务器端变量

请教如何在javascript中调用服务器端变量if(% session.getAttribute(authority) %!teacher){alert

请教如何在javascript中调用服务器端变量
if(<%= session.getAttribute("authority") %>!="teacher")
{
  alert("你没有权限");
return false;
}
这是我写的代码,有错误,效果出不来
请高人指教啊
谢谢先拉

[解决办法]

Java code
if( <%=session.getAttribute("authority") !="teacher"%>) {                 alert("你没有权限"); return   false; }
[解决办法]
LS语法有误,应该是
if('<%= !session.getAttribute("authority").toString().equals("teacher")%>')