jsp session variable in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saurabhjj
    New Member
    • Mar 2007
    • 2

    #1

    jsp session variable in javascript

    hi,
    i want use a jsp session variable inside a javascript code, for this i am using the following function,

    function checkList()
    {
    <% String ecode1=(String) session.getAttr ibute("e_numb") ; %>
    var code=<%=ecode1% >
    alert (code)
    }

    this is showing an error can any one please help me,

    thanks saurabh
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You'll need to include it within quotes.

    Comment

    Working...