Title: Embedding javascript in a post
Last modified: August 19, 2016

---

# Embedding javascript in a post

 *  [Nick](https://wordpress.org/support/users/njprrogersgmailcom/)
 * (@njprrogersgmailcom)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/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("http://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)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/embedding-javascript-in-a-post/#post-1910740)
 * [http://wordpress.org/extend/plugins/inline-javascript/](http://wordpress.org/extend/plugins/inline-javascript/)
 * prolly need a plugin to allow it…
 * haven’t tested the one I posted, but you can try it or look for others

Viewing 1 replies (of 1 total)

The topic ‘Embedding javascript in a post’ is closed to new replies.

## Tags

 * [embed](https://wordpress.org/support/topic-tag/embed/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/embedding-javascript-in-a-post/#post-1910740)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
