Javascript doesn’t work, only through WP
-
I’m at a loss. Hope someone might have an idea for me.
I don’t use javascript very often, but I have a situation that calls for it. I’m using two js files to create a tab effect on a page.
The script and html/css works fine if I use it as a stand alone.
When I include in my sidebar, it suddenly doesn’t work at all anymore.
I placed both js files in a folder called /js in my theme.
The files are tabs.js and prototype.js
I call both of the js through the head of my document as is:
<script src="<?php bloginfo('url'); ?>/wp-content/themes/mythemename/js/tabs.js" type="text/javascript" ></script>
I include a bit more of js that actually triggers the script as follows:
<script type="text/javascript"> <!-- Event.observe(window,'load',function(){ $$('.tabs').each(function(tabs){ new Control.Tabs(tabs); }); }); //--> </script>
I read through https://codex.www.ads-software.com/Using_Javascript#Using_Multiple_Javascript_Files_inside_one_post_or_page and spend a couple hours sifting through this forum, haven’t found a thing.
I tried removing most WP calls from the head, removed the actual post stuff and only loading the sidebar. To no avail.
There’s obviously a conflict somewhere. But I can’t, for the life of me, figure out what might be not happy.
Unfortunately, I don’t have a live site to show you at the moment, it’s all local. Early on the design process of the site, but if this tab feature won’t work, I have to abandon the design
Thanks for any assistance.
- The topic ‘Javascript doesn’t work, only through WP’ is closed to new replies.