Hello all,
I have been searching for hours and reading multiple posts and discussions about various ways to implement Javascript into a Drupal 6 site. But NONE of them have actually shown how to SIMPLY call a small javascript into a block. They all show how to put some js into your WHOLE theme or template or page, these all cause an action to happen or something that happens to the OVERALL page, but nothing in a SPECIFIC area or block.

I am trying to call a simple code to show up in a block.

<script type="text/javascript" src="http://www.atozmedia.com/common/soundcard/widget/Soundcard.js" language="javascript"></script>

I want this Widget to show up in a specific block.

What is the easiest most simple way to make this happen?

I've tried editing the template.php
I've tried a new external .js file that's place in the js folder inside my theme...
I don't know if any of these are actually working, cause I don't know HOW to make them actually appear somewhere on the site.

This seems like it should be fairly straight forward, but I've only found half answers and vague responses or overly in depth module building, etc.

Thanks ahead of time!

Comments

chronnus’s picture

You can add a block in the blocks page, put in the javascript, and make sure the input filter is set to full html (or any input filter). You can then put the block in whichever region you want it to show.

Jeremy Toaster’s picture

Thanks for the quick reply.
I have tried HTML, Filtered, UNfiltered, PHP, etc.
All of them end up just showing the pasted code and does not allow the .js function to be called and placed into the block.

Do you know what combination of CLEANUP options should and should not be check boxed?

chronnus’s picture

Hmm, is a wysiwyg editor enabled when you paste the code into the block? If so you will need the editor turned off, otherwise it'll usually wrap your js in a code HTML tag. Also the editor tends to cleanup any js code.

Jeremy Toaster’s picture

Ah yes! Once I clicked the "disable rich text", the script went through just fine!
Thank you very much!