$().ready(function () { var myBalance="<%=session.getAttribute("myBalance")%>"; alert(myBalance); });