Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   [SOLVED] problem with JavaScript in pages (http://forum.bytesforall.com/showthread.php?t=11281)

marek91 Nov 20, 2010 12:28 PM

[SOLVED] problem with JavaScript in pages
 
Hey, I am trying to add a unit converter to one of my pages from http://unitconversion.org/. The code that was provided by the site was:

HTML Code:

<!-- DENSITY CONVERTER START -->
<form style="padding:0;margin:0" name="cat=Density">
<table align=center width=500 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</option><option value="kilogram/cubic centimeter">kilogram/cubic centimeter</option><option value="gram/cubic meter">gram/cubic meter [g/m^3]</option><option value="gram/cubic centimeter">gram/cubic centimeter</option><option value="gram/cubic millimeter">gram/cubic millimeter</option><option value="milligram/cubic meter">milligram/cubic meter</option><option value="milligram/cubic centimeter">milligram/cubic centimeter</option><option value="milligram/cubic millimeter">milligram/cubic millimeter</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)</option><option value="pound/gallon (UK)">pound/gallon (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)</option><option value="ounce/gallon (UK)">ounce/gallon (UK)</option><option value="grain/gallon (US)">grain/gallon (US)</option><option value="grain/gallon (UK)">grain/gallon (UK)</option><option value="grain/cubic foot">grain/cubic foot [gr/ft^3]</option><option value="ton (short)/cubic yard">ton (short)/cubic yard</option><option value="ton (long)/cubic yard">ton (long)/cubic yard</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</option><option value="kilogram/cubic centimeter">kilogram/cubic centimeter</option><option value="gram/cubic meter">gram/cubic meter [g/m^3]</option><option value="gram/cubic centimeter">gram/cubic centimeter</option><option value="gram/cubic millimeter">gram/cubic millimeter</option><option value="milligram/cubic meter">milligram/cubic meter</option><option value="milligram/cubic centimeter">milligram/cubic centimeter</option><option value="milligram/cubic millimeter">milligram/cubic millimeter</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)</option><option value="pound/gallon (UK)">pound/gallon (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)</option><option value="ounce/gallon (UK)">ounce/gallon (UK)</option><option value="grain/gallon (US)">grain/gallon (US)</option><option value="grain/gallon (UK)">grain/gallon (UK)</option><option value="grain/cubic foot">grain/cubic foot [gr/ft^3]</option><option value="ton (short)/cubic yard">ton (short)/cubic yard</option><option value="ton (long)/cubic yard">ton (long)/cubic yard</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 -->

The unit converter shows up fine on the page as expected, but once you try and use it does not respond. I think the problem lies in the call to the JavaScript file;

HTML Code:

<script src=http://www.unitconversion.org/converter3/converter3.js></script>
as Ive heard of some problems with JavaScript in WordPress. I tried adding the following lines of code in replace of the code above as suggested by Docs in WordPress;

HTML Code:

<script type="text/javascript" src="http://www.unitconversion.org/converter3/converter3.js"></script>
It did not change anything. I would be incredibly helpful if someone could help me or lead me in the proper direction. Thanks in advance.

juggledad Nov 20, 2010 01:02 PM

looks like their code REQUIRES a linkback to their site

marek91 Nov 20, 2010 02:12 PM

Yes it does, i'm sorry I forgot to mention so. When I attempted to use the code I also included the link back:

HTML Code:

<a href="http://www.unitconversion.org">UnitConversion.org</a> - the ultimate unit conversion resource.

juggledad Nov 20, 2010 02:18 PM

don't know what to say. I copied their length converter and it worked fine for me. I suggest you try to contact them about what is wrong with the java

marek91 Nov 26, 2010 10:31 PM

Yes I did use that plugin but It didn't work too well. Thanks Though.

So, I figured out that there is nothing wrong with their JavaScript. I switched my Theme to the default WordPress theme they give you when you first download it, and the converter worked perfectly well.
Taking this into account I am inclined to think that the reason the converter isn't working in Atahualpa is because of one of the theme options, or at least something specific to the Atahualpa Theme and not WordPress.

I am just learning how to work with this theme and would be really grateful if someone could help me out, as this has proved to be an incredibly vexing problem for me.

Thanks in advance!

juggledad Nov 28, 2010 02:58 PM

just where did you put the code?
I just put the code and the linkback in a post and it works fine

marek91 Nov 28, 2010 05:53 PM

Hey juggledad. That is very very odd. Here's a link to where I put my converter;

http://enggplusplus.org/unit-conversion

It just says "loading, please wait..." and stays like that, when I added it to the default theme it worked perfectly well and gave an answer right away.

I just added it in Page Edit in WordPress. I also created a custom page template and included the code in that, and it gave the same response.

marek91 Nov 28, 2010 10:29 PM

I figured it out!

Turns out I had a corrupted option bfa_ata4 in my database.
I was fiddling around in Theme Options and I deleted the option 'bfa_ata4', once I reloaded my site the converter was working perfectly. Only downside is that I forgot to Export my settings, but I am happy nonetheless.

Thanks to all who replied.


All times are GMT -6. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.