Can’t get basic Javascript functions working…please help
-
Hi,
Please note I am doing this on a blog hosted by myself, not a wordpress.com blog. Cheers.
I’m new to the forums and relatively new to WordPress. I’m usually a .Net developer, but WordPress is so good for quickly deploying and easily managing websites and blogs, I like to use it, and recommend it to a lot of people.
The problem i’m having with it though is that I can’t seem to find out where to put my Javascript.
For starters i’d like to just make a simple alert box pop up on each page, just to show it’s working.
I had assumed going into the folder for my active theme and adding the code to the header.php file between the <head></head> tags would do the trick…but no alert box.
I know this may not be the optimal way to do it, but first things first I just want to see a bit of Javascript work in my WordPress site.
Can’t seem to find anywhere that just talks about the basic way to do this (probably as it’s useless other than to test it’s working).
I assumed header.php was just included at the top of all pages that use the theme, but tried adding in some comments to it, and they didn’t appear in the pages when I viewed source even.
I just want to know where I can put my JS code for the alert box to make it work first…Simple question, which i’m assuming has a simple answer.
So any help is really appreciated.
The blog I need help with is: (visible only to logged in users)
-
I only read as far as your first line: Blogs that are hosted other than at WordPress.com need to seek assistance at WordPress.ORG instead. Our answers won’t apply to you because for one thing, we don’t have access to the php on our themes, and javascript is stripped out here automatically.
-
-
Hello,
Try installing a plugin that gets rid of WP autoformatting (meaning no
on line breaks). Can’t remember the plugin name. Just search “auto formatting” and it should come up.That should fix the Javascripts. However, you’ll now need to use an HTML editor outside of wordpress, then copy and past your code in.
-
@thewordpresswizard
You may not be aware of this but we regular Volunteers do have wordpress.ORG blogs too, but we don do not provide support on this wordpress.COM forum to wordpress.ORG bloggers.If you want to provide support please, please, pretty please do that over here http://wordpress.ORG/support and that will ensure that we don’t get a flood of wordpress.ORG bloggers seeking solutions here.
As it is about 30% of the threads posted here are being posted by wordpress.ORG bloggers who fail to read the sticky post at the head of the forum, so your cooperation would really be appreciated.
Thanks, for listening.
- The topic ‘Can’t get basic Javascript functions working…please help’ is closed to new replies.