Support » Fixing WordPress » Javascripts in WordPress…Please help!

Viewing 15 replies - 1 through 15 (of 20 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    When editing themes to add stuff like that, remember that the purpose of the theme is just to generate the resulting page for the browser. So always work based on what the browser is seeing. Use the View Source on your website to see what is actually making it to the browser. This is helpful in theme editing, especially for javascript which is not running in the theme, but running on the final webpage.

    Thread Starter mechietechie

    (@mechietechie)

    Thanks for your response.
    I’ve looked at the source, and it displays the code the way it shud…it also does that on the site (http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_83.html) where i found the code.

    If you take a look at the way the menu shud look, the red box and the title next to it are all you see at first…on my site, the only thing that comes up is the title…the red box is missing. From this i can assume that for some reason the style tags are not being read properly.
    any thoughts?
    thanks

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Unless you post the site where you’re trying to put this in, there’s no way anybody will be able to look at what you’ve got and help you out.

    Best I can say is to look closer at your CSS.

    Thread Starter mechietechie

    (@mechietechie)

    Thats a darn good idea:

    http://mechietechie.com/wp/

    you can see where the menu shud be in the sidebar on the right…

    also, if you visit the site in IE, you’ll notice a huge alignment error, that doesnt occur in firefox…still trying to figure that one out…any thoughts on that are also welcome!

    ill keep sifting through my CSS (http://mechietechie.com/wp/wp-content/themes/frametheme/style.css)
    , but i cant find any bugs in it yet (im sure there are)

    Thread Starter mechietechie

    (@mechietechie)

    nope, cudnt find anything wrong in my CSS…any thoughts?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    I took a look but the resulting html is way over my head. There is some complex stuff going on there. Everything looks good to me except I’m not certain about the position: absolute in the CSS.

    You might try making it work on a test page all by itself and see if you can get it working there. Just a thought.

    Thread Starter mechietechie

    (@mechietechie)

    Thanks for taking the time!
    I did make a test page, just copied the neccesary text, and it worked fine as html. not sure wut else to do

    Unless you scale down some of the images in your main container your sidebar will never perform correctly. Adjust the images to a size slightly smaller than your main container size and odds are your code will start working. Also, it’s a good idea to wrap your javascript with <div> tags.
    <div>javacode</div>

    Thread Starter mechietechie

    (@mechietechie)

    thanks samboll, that might help with the IE alignment. i did mess around with the pixel numbers a bit, and havent had a chance to re-do that…but on the template i started from, the picture was proportional, so it shud cause so much of a problem

    Thread Starter mechietechie

    (@mechietechie)

    hmm, ive been thru everything, and cant seem to figure it out.

    any more thoughts?

    Hi There,

    This should fix your solution WordPress JavaScript Plugin for Posts : http://www.acmetech.com/blog/2006/03/19/wordpress-javascript-plugin/

    Example over @ http://www.renewedreflections.com/bmi-calculator-body-mass-index/ ( You can checkout Michael’s Body Mass Index Calculator JavaScript within a WordPress post. )

    Though this plugin was intended for AdSense Integration, the actual work of the plugi is to display javascript on the sites and hence you javascript should work perfectly!

    Have Fun 🙂

    – Dreamchaser

    Thread Starter mechietechie

    (@mechietechie)

    hey dreamchaser
    thanks for the effort, but this is for posts, will it work out for the template? i think part of the problem is that the code refers to definitions in the style sheet, and it seem that thos arnt being read.
    thanks
    anyother thoughts?

    Thread Starter mechietechie

    (@mechietechie)

    ive tried everything, and at this point im fairly certain ther’s an solely an issue in reading the style sheet. any thoughts on how to resolve that?

    Thread Starter mechietechie

    (@mechietechie)

    no luck yet for me…anyone else??

    I notice that your page output is not valid XHTML:

    http://validator.w3.org/check?uri=http%3A%2F%2Fmechietechie.com%2Fwp%2F

    It’s possible that the W3C validation service doesn’t know how to ignore javascript, so I’m not sure if that’s the reason for the errors. Try taking the javascript out and re-validate again.

    EDIT: Just tried accessing your page using Firefox 1.5 and I get lots of errors in the javascript console. A sample follows:

    Error: Unknown property ‘filter’. Declaration dropped. Source File: ttp://mechietechie.com/wp/wp-content/themes/frametheme/style.css Line: 63

    Error: Error in parsing value for property ‘width’. Declaration dropped. Source File: http://mechietechie.com/wp/wp-content/themes/frametheme/style.css Line: 401

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Javascripts in WordPress…Please help!’ is closed to new replies.