Title: Problems with javascript
Last modified: August 18, 2016

---

# Problems with javascript

 *  [dominic_traynor](https://wordpress.org/support/users/dominic_traynor/)
 * (@dominic_traynor)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/)
 * I know that there are many existing posts on putting javascript in posts but 
   I cant make sense of them. Sorry.
    I want to put in the following script from
   an external site into a post on my site but it doesnt work at the mo when I paste
   it straight in.
 * <!– Begin MagicSeaweed.com Chart Code
    (c) Metcentral Ltd 2005 You are welcome
   to embed this code in your website to deliver our latest swell charts to surfers.
   We’d appreciate it if you leave this message and all code contained in this section
   as is and unmodified. If you link directly to the image it won’t work as we change
   the URL periodically. Thanks! – Ben –> <script type=”text/javascript” src=”[http://data.metcentral.com/jscript/swellChart.js”&gt](http://data.metcentral.com/jscript/swellChart.js”&gt);
   </script> <div style=”width: 550px; text-align: center”> [MagicSeaweed.com Surf Forecast](http://magicseaweed.com)
   </div> <!– End MagicSeaweed.com Chart Code –>
 * I read in one thread that I should ‘call it’ but I have no idea what this means.
   Could someone please give me a dummies guide to putting javascript in a post?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208480)
 * Link to the exact page on the above site which covers this ?
 *  Thread Starter [dominic_traynor](https://wordpress.org/support/users/dominic_traynor/)
 * (@dominic_traynor)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208482)
 * The link is:
    [http://magicseaweed.com/UK_Swell,_Period_and_Wind/143](http://magicseaweed.com/UK_Swell,_Period_and_Wind/143)
 * Thanks
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208483)
 * heh – that’s BIG 🙂 [http://www.tamba2.org.uk/T2/](http://www.tamba2.org.uk/T2/)
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208484)
 * Edit your header template. Inside the
    `<head> ` and `</head>` tags you want 
   to place this bit: `<script type="text/javascript" src="http://data.metcentral.
   com/jscript/swellChart.js"> </script>
 * Then wherever in your blog you want the images, place this:
    `<div style="width:
   550px; text-align: center"> <a style="font-family: verdana; font-size: 10px; 
   color: #000000" href="http://magicseaweed.com">MagicSeaweed.com Surf Forecast
   </a> </div>
 * I’ve left out the credits stuff here for space, and you could also use css to
   do the styling for the second part.
 *  [lbessant](https://wordpress.org/support/users/lbessant/)
 * (@lbessant)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208487)
 * Just tried that on a test site, and if you paste it in exactly as shown, it won’t
   work. That’s because of the line break in the `<script>` tag. WP inserts `<br
   >` tags, which breaks the script.
 * Edit this bit:
 * `<script type="text/javascript"
    src="http://data.metcentral.com/jscript/swellChart.
   js"> </script>
 * To this:
 * `<script type="text/javascript" src="http://data.metcentral.com/jscript/swellChart.
   js"></script>`
 * And it should work. (If it wraps above, just make sure there is no line break
   in your post between “text/javascript” and src.
 *  Thread Starter [dominic_traynor](https://wordpress.org/support/users/dominic_traynor/)
 * (@dominic_traynor)
 * [20 years, 12 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-208490)
 * Sounds simple enough which makes me slightly warey.
 * Thanks for your help
 *  [stfarm](https://wordpress.org/support/users/stfarm/)
 * (@stfarm)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-209408)
 * That sure worked for me, thank you.
 * Steve
    [http://www.GeekTavern.com](http://www.GeekTavern.com)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problems with javascript’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [stfarm](https://wordpress.org/support/users/stfarm/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/problems-with-javascript/#post-209408)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
