0

I have this java code in jsp page ::

<%
String temp1;
PopulateTextbox obj = new PopulateTextbox();
temp1 = obj.method();
%>

And on the same jsp page i have javascript code ::

<script type="text/javascript">
var storedata={
            identifier:"table1",
            label:"name",
            items: temp1
    };
    var gridStructure =[{
    cells:[
                [
                      { field: "ID",
                            name: "ID_Emp",
                            width: "40%", styles: 'text-align: right;'
                      },
                      {
                          field: "Names",
                          name: "Name",
                          width: "40%", styles: 'text-align: right;'
                      }

                ]
          ]
    }];
</script>

Now here temp1 is common. I want that the variable temp1 can be passed on to or javascript code. how to do that ? thanks.

1
  • 2
    var jsTempValue = "<%= temp1 %>"; Commented Mar 5, 2012 at 11:32

1 Answer 1

1
<script type="text/javascript">
var storedata={
            identifier:"table1",
            label:"name",
            items: <%=temp1%>
            ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.