Value is not passed on javascript code in django -
i new django , javascript both. , using highcharts displaying charts. problem @ template file.
visualise.html contains
<script type="text/javascript"> var yname_agewise_total_call_duration = {{ yname.agewise_total_call_duration|safe }}; var yname_agewise_weekly_total_call_duration = {{ yname.agewise_weekly_total_call_duration|safe }}; </script>
i tested value of yname.agewise_total_call_duration
, yname.agewise_weekly_total_call_duration
in html file shows well. when want use value yname_agewise_total_call_duration
, yname_agewise_weekly_total_call_duration
in javascript file charts.js cannot show values. tried in charts.js as
alert(yname_agewise_total_call_duration);
the popup displays undefined.
what problem here ? how solve ?
in javascript, undefined means variable has been declared has not yet been assigned value. check on browser console whether yname_agewise_total_call_duration holds data or not
Comments
Post a Comment