CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2012
    Posts
    5

    JSP / Javascript

    I want to use a variable's value which i am getting through resultset from database in jsp scriptlets in my javascipt code .

    i want to display that variable in javascript .

    or if you can suggest me how can i use javascript inside scriptlets

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: JSP / Javascript

    [ moved thread ]
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: JSP / Javascript

    Just output the variable inside of <script> tags.

    Code:
    <script type="text/javascript">
    var jspVariable = "<&#37;=jsp_variable %>";
    </script>
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    May 2012
    Posts
    5

    Re: JSP / Javascript

    No that won't help in my case

    My case is like this

    Javascript{

    I want to use that object in this javascript

    }

    <%
    there is my resultset object

    %>

  5. #5
    Join Date
    May 2002
    Posts
    10,943

    Re: JSP / Javascript

    Yes it will. You're forgetting that JSP is server side and will output before the page is executed on the JavaScript side.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured