Title: Calling Javascript In WordPress Pages
Last modified: August 19, 2016

---

# Calling Javascript In WordPress Pages

 *  Resolved [marek91](https://wordpress.org/support/users/marek91/)
 * (@marek91)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/calling-javascript-in-wordpress-pages/)
 * Hello,
 * I tried adding a unit converter to one of my pages and it doesn’t work. The code
   works perfectly well when I run it on the web from Notepad++, it only has problems
   in WordPress.
 * Here is the unit converter html (skip to after </form>)
 *     ```
       <!-- DENSITY CONVERTER START -->
       <form style="padding:0;margin:0" name="cat=Density">
       <table align=center width=650 style="font-family:Verdana;font-size:100%" border=0 cellpadding=0 cellspacing=0><tr><td style="padding:1.2ex 1.5ex;width:50%;font-family:Verdana;font-size:13px">From:<br><input style="width:100%;font-family:Verdana;font-size:100%" type=text name="bindid=left;base=1"></td><td style="padding:1.2ex 1.5ex;width:50%;font-family:Verdana;font-size:13px">To:<br><input style="width:100%;font-family:Verdana;font-size:100%" type=text name="bindid=right"></td></tr><tr><td style="padding:1.2ex 1.5ex;width:50%;font-family:Verdana;font-size:13px">
       <select name=left size=14 style="width:100%;font-family:Verdana;font-size:100%"><option value="kilogram/cubic meter" selected>kilogram/cubic meter [kg/m^3]</option><option value="kilogram/cubic centimeter">kilogram/cubic centimeter [kg/cm^3]</option><option value="gram/cubic meter">gram/cubic meter [g/m^3]</option><option value="gram/cubic centimeter">gram/cubic centimeter [g/cm^3, g/cc]</option><option value="gram/cubic millimeter">gram/cubic millimeter [g/mm^3]</option><option value="milligram/cubic meter">milligram/cubic meter [mg/m^3]</option><option value="milligram/cubic centimeter">milligram/cubic centimeter [mg/cm^3]</option><option value="milligram/cubic millimeter">milligram/cubic millimeter [mg/mm^3]</option><option value="exagram/liter">exagram/liter [Eg/L]</option><option value="petagram/liter">petagram/liter [Pg/L]</option><option value="teragram/liter">teragram/liter [Tg/L]</option><option value="gigagram/liter">gigagram/liter [Gg/L]</option><option value="megagram/liter">megagram/liter [Mg/L]</option><option value="kilogram/liter">kilogram/liter [kg/L]</option><option value="hectogram/liter">hectogram/liter [hg/L]</option><option value="dekagram/liter">dekagram/liter [dag/L]</option><option value="gram/liter">gram/liter [g/L]</option><option value="decigram/liter">decigram/liter [dg/L]</option><option value="centigram/liter">centigram/liter [cg/L]</option><option value="milligram/liter">milligram/liter [mg/L]</option><option value="microgram/liter">microgram/liter [µg/L]</option><option value="nanogram/liter">nanogram/liter [ng/L]</option><option value="picogram/liter">picogram/liter [pg/L]</option><option value="femtogram/liter">femtogram/liter [fg/L]</option><option value="attogram/liter">attogram/liter [ag/L]</option><option value="pound/cubic inch">pound/cubic inch [lb/in^3]</option><option value="pound/cubic foot">pound/cubic foot [lb/ft^3]</option><option value="pound/cubic yard">pound/cubic yard [lb/yd^3]</option><option value="pound/gallon (US)">pound/gallon (US) [lb/gal (US)]</option><option value="pound/gallon (UK)">pound/gallon (UK) [lb/gal (UK)]</option><option value="ounce/cubic inch">ounce/cubic inch [oz/in^3]</option><option value="ounce/cubic foot">ounce/cubic foot [oz/ft^3]</option><option value="ounce/gallon (US)">ounce/gallon (US) [oz/gal (US)]</option><option value="ounce/gallon (UK)">ounce/gallon (UK) [oz/gal (UK)]</option><option value="grain/gallon (US)">grain/gallon (US) [gr/gal (US)]</option><option value="grain/gallon (UK)">grain/gallon (UK) [gr/gal (UK)]</option><option value="grain/cubic foot">grain/cubic foot [gr/ft^3]</option><option value="ton (short)/cubic yard">ton (short)/cubic yard [t (short)/yd^3]</option><option value="ton (long)/cubic yard">ton (long)/cubic yard [t (long)/yd^3]</option><option value="slug/cubic foot">slug/cubic foot [slug/ft^3]</option><option value="psi/1000 feet">psi/1000 feet</option><option value="Earth's density (mean)">Earth's density (mean)</option></select></td><td style="padding:1.2ex 1.5ex;width:50%;font-family:Verdana;font-size:13px">
       <select name=right size=14 style="width:100%;font-family:Verdana;font-size:100%"><option value="kilogram/cubic meter" selected>kilogram/cubic meter [kg/m^3]</option><option value="kilogram/cubic centimeter">kilogram/cubic centimeter [kg/cm^3]</option><option value="gram/cubic meter">gram/cubic meter [g/m^3]</option><option value="gram/cubic centimeter">gram/cubic centimeter [g/cm^3, g/cc]</option><option value="gram/cubic millimeter">gram/cubic millimeter [g/mm^3]</option><option value="milligram/cubic meter">milligram/cubic meter [mg/m^3]</option><option value="milligram/cubic centimeter">milligram/cubic centimeter [mg/cm^3]</option><option value="milligram/cubic millimeter">milligram/cubic millimeter [mg/mm^3]</option><option value="exagram/liter">exagram/liter [Eg/L]</option><option value="petagram/liter">petagram/liter [Pg/L]</option><option value="teragram/liter">teragram/liter [Tg/L]</option><option value="gigagram/liter">gigagram/liter [Gg/L]</option><option value="megagram/liter">megagram/liter [Mg/L]</option><option value="kilogram/liter">kilogram/liter [kg/L]</option><option value="hectogram/liter">hectogram/liter [hg/L]</option><option value="dekagram/liter">dekagram/liter [dag/L]</option><option value="gram/liter">gram/liter [g/L]</option><option value="decigram/liter">decigram/liter [dg/L]</option><option value="centigram/liter">centigram/liter [cg/L]</option><option value="milligram/liter">milligram/liter [mg/L]</option><option value="microgram/liter">microgram/liter [µg/L]</option><option value="nanogram/liter">nanogram/liter [ng/L]</option><option value="picogram/liter">picogram/liter [pg/L]</option><option value="femtogram/liter">femtogram/liter [fg/L]</option><option value="attogram/liter">attogram/liter [ag/L]</option><option value="pound/cubic inch">pound/cubic inch [lb/in^3]</option><option value="pound/cubic foot">pound/cubic foot [lb/ft^3]</option><option value="pound/cubic yard">pound/cubic yard [lb/yd^3]</option><option value="pound/gallon (US)">pound/gallon (US) [lb/gal (US)]</option><option value="pound/gallon (UK)">pound/gallon (UK) [lb/gal (UK)]</option><option value="ounce/cubic inch">ounce/cubic inch [oz/in^3]</option><option value="ounce/cubic foot">ounce/cubic foot [oz/ft^3]</option><option value="ounce/gallon (US)">ounce/gallon (US) [oz/gal (US)]</option><option value="ounce/gallon (UK)">ounce/gallon (UK) [oz/gal (UK)]</option><option value="grain/gallon (US)">grain/gallon (US) [gr/gal (US)]</option><option value="grain/gallon (UK)">grain/gallon (UK) [gr/gal (UK)]</option><option value="grain/cubic foot">grain/cubic foot [gr/ft^3]</option><option value="ton (short)/cubic yard">ton (short)/cubic yard [t (short)/yd^3]</option><option value="ton (long)/cubic yard">ton (long)/cubic yard [t (long)/yd^3]</option><option value="slug/cubic foot">slug/cubic foot [slug/ft^3]</option><option value="psi/1000 feet">psi/1000 feet</option><option value="Earth's density (mean)">Earth's density (mean)</option></select></td></tr><tr><td colspan=2 style="padding:1.2ex 1.5ex;font-family:Verdana;font-size:13px">Result:<br><input style="width:100%;font-family:Verdana;font-size:100%" type=text name="type=result;bindid=left;bindid2=right"></td></tr></table>
       </form>
   
       <script src=http://www.unitconversion.org/converter3/converter3.js></script>
   
       <!-- DENSITY CONVERTER END -->
   
       <!--LINK_BACK-->
       <p style="text-align:center;"><a href="http://www.unitconversion.org">UnitConversion.org</a> - the ultimate unit conversion resource.</p>
       ```
   
 * The link back is needed as a condition of me using the author’s code. I think
   the problem is in:
 * `<script src=http://www.unitconversion.org/converter3/converter3.js></script>`
 * I am not familiar with calling JavaScript to WordPress pages and was hoping someone
   could lead me in the right direction. Many Thanks:)

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/calling-javascript-in-wordpress-pages/#post-1775337)
 * [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)
 *  Thread Starter [marek91](https://wordpress.org/support/users/marek91/)
 * (@marek91)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/calling-javascript-in-wordpress-pages/#post-1775411)
 * Yes, I looked over that.
 * So far I’ve tried calling the script like so:
 * `<script type="text/javascript" src="http://www.unitconversion.org/converter3/
   converter3.js"></script>`
 * which didn’t change anything. I also tried uploading the sites JavaScript files
   to my site and called it as follows:
 * `<script>uc_datapath="/http://www.enggplusplus.org/conversion/converter3-engine/
   converter3.js"</script><script src=/http://www.enggplusplus.org/conversion/converter3-
   engine/converter3.js></script>`
 * and right beneath…
 *     ```
       <script type="text/javascript">
       <!--
       jx2_0();
       //--></script>
       ```
   
 * I put these codes directly into the HTML editor on WordPress pages.
    None of 
   them have worked for me, I have also tried contacting unitconversion.org multiple
   times but they have not replied of late.

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

The topic ‘Calling Javascript In WordPress Pages’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [marek91](https://wordpress.org/support/users/marek91/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/calling-javascript-in-wordpress-pages/#post-1775411)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
