Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] problem with JavaScript in pages


  #1  
Old Nov 20, 2010, 11:28 AM
marek91
 
5 posts · Nov 2010
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 I’ve 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.
  #2  
Old Nov 20, 2010, 12:02 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
looks like their code REQUIRES a linkback to their site
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Nov 20, 2010, 01:12 PM
marek91
 
5 posts · Nov 2010
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.
  #4  
Old Nov 20, 2010, 01:18 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Nov 26, 2010, 09:31 PM
marek91
 
5 posts · Nov 2010
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!
  #6  
Old Nov 28, 2010, 01:58 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
just where did you put the code?
I just put the code and the linkback in a post and it works fine
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Nov 28, 2010, 04:53 PM
marek91
 
5 posts · Nov 2010
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.
  #8  
Old Nov 28, 2010, 09:29 PM
marek91
 
5 posts · Nov 2010
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.

Bookmarks

Tags
javascript, javascript add, javascript in pages, pages

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting problem on post-title on multi-pages The Foxy! Center area post/pages 4 Jul 27, 2010 08:40 AM
Recurring problem trying to access Pages OttO Plugins & Atahualpa 6 Nov 27, 2009 04:38 AM
Problem Customizing Widgets on Different Pages davidferris Sidebars & Widgets 1 Apr 27, 2009 08:00 PM
Inserting Javascript on main page won't work but individual pages will everydayexplorer Atahualpa 3 Wordpress theme 2 Apr 11, 2009 10:31 PM


All times are GMT -6. The time now is 02:45 PM.


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