Problems using jQuery and variable

Please help me, I am trying to create graphs (in django) using jQuery.

Example: http://jsfiddle.net/eM2Mg/

But when I try to send values ​​to a variable, jQuery crashed, please explain to me.

There is my code:

<script>
var values = "{{ values }}";
var values2 = values.replace(/enter_key/g, '\\n')
values = values2.replace(/&quot;/g, '"')
g = new Dygraph(document.getElementById("graph"), values, {
                     legend: 'always',
                     animatedZooms: true,
                     title: 'dygraphs chart template'
                 });          
</script>

      

The values ​​were my string when I alert(values)

see the same format for the graph: http://www.ex.ua/615449293535

Help me! thank

+3


source to share


1 answer


To pass the variable, you will need to use a textbox and use each function, and make and array use each function you can see the source code of the mumbaisos.com search list page which contains its logic



0


source







All Articles