Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Any idea how to put java script into sidebar text widget? (http://forum.bytesforall.com/showthread.php?t=12437)

Innocent Jan 24, 2011 03:33 PM

[SOLVED] Any idea how to put java script into sidebar text widget?
 
I would like to have a menu and have generated a code that goes like this:
<script src="acac1.js" type="text/javascript"></script><!-- Accordion Script by Gokhan Dagli --><script>ac1init_doc('',1);</script>

I don't have a clue what to insert into my WP content or code to make it visible or is it even possible.

Please, help!

juggledad Jan 24, 2011 06:03 PM

add a text widget to the sidebar
add the code to the text widget

Innocent Jan 25, 2011 04:18 AM

I tried that, it's not showing.
Look, the widget is called 'java' in left sidebar.
http://kteis.com/shop/

GarethP Jan 25, 2011 05:10 AM

looking at the source I see

<script type="text/javascript"><script src="acac1.js" type="text/javascript"></script>

do you need to better define the location of the acac1.js script?

Innocent Jan 25, 2011 05:13 AM

Yes, probably, thanks for looking!
I don't know how to do that. Where should I store it?
I am totally inexperienced with this, so all info is welcome.

GarethP Jan 25, 2011 05:55 AM

Where do you have it stored now?

I would probably go for a sub-folder under wp-content. That's generally safe form any future WordPress core updates.

Innocent Jan 25, 2011 05:58 AM

I put acac1.js in wp-content/uploads.

GarethP Jan 25, 2011 06:25 AM

I've done some investigation about the javascript Accordion Menu you are using and...

OK assuming you have WordPress installed in the www root then I think the first part of your script should be something like;

<script src="/wp-content/uploads/acac1.js" type="text/javascript"></script>

you then have this as the second part;

<script>/wp-content/uploads/ac1init_doc('',1);</script>

Now I believe that between the two '' there should be a folder name which contains the graphics for the menu

Assuming your images are in the menu_images folder I think it should be something like;

<script>/wp-content/uploads/ac1init_doc('/wp-content/uploads/menu_images/',1);</script>

Innocent Jan 25, 2011 07:09 AM

Thank you so much for your time and effort, I didn't get it to work completely, but I understood how java works in widgets and I am planing to use different application anyway :p


All times are GMT -6. The time now is 11:09 PM.

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