Embedding javascript in a post
-
Hi,
I’m embedding some javascript into a post but it is rendering as follows:
<div id="chartdiv">FusionCharts</div> <p><script type="text/javascript">// <![CDATA[ var myChart = new FusionCharts("https://redcresearch.ie/Charts/MSLine.swf", "FusionCharts_1", "600", "600", "1", "0"); myChart.setDataURL("/FusionChartsData/data.xml"); myChart.render("chartdiv");</p> <p>// ]]></script></p>
You’ll notice the $gt; at the end there which is messing up my attempt to render a chart. The output is coming form the_content();
Unfortunately, I want the Editor of the site to be able to add these pieces of script regularly – creating a new .js file each time isn’t really an option.
The funny thing is, this post is rendering o.k. from content(60) in index.php ( I guess it isn’t formatting the output through that ).
Can anyone help me with this? I’m tearing out what is left of my hair (not much).
Thanks,
Nick
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Embedding javascript in a post’ is closed to new replies.