String to Script

String to Script

Hi All,

This is the first time I am using JQuery for simple script execution. Here is my issue, I am using a charting library for generating the charts. The number of charts and data of the chart is dynamic. So I have generated the chart script on the backend using strings and stored the whole script string in a session variable. I am using struts2 and JSP for the front end. When I retrieve the session variable, it comes out as a string. 

How can I convert this to a javascript.