By jameshuf on
I am sure there is some simple way to do this, but I cannot figure it out nor can I find any help searching past posts...
All I want to do is insert the following javascript image map into a block. Unfortunately I am not a programmer, so please give me the "dummy" instructions...
Thank you VERY much!!
<head>
<script type='text/javascript' language="javascript">
Image0 = new Image(400,286);
Image0.src = "galap_map_base.gif";
Image1 = new Image(400,286);
Image1.src = "galapagos_map_santacruz.gif";
function changeImage(picture) {
document.main.src = picture.src; return true;
}
</script>
</head>
<map name="galapagos_map">
<area shape="rect" coords="148,142,174,167" onMouseOver="changeImage(Image1)" onMouseOut="changeImage(Image0)" />
</map>
<img src="galap_map_base.gif" border="0" name="main" usemap="#galapagos_map"/>
Comments
paste the code with correct
paste the code with correct path settings into 'add new block' , choosing input formatting as 'full html'
-- Sree --
IRC Nick: sreeveturi
Your best bet would be to
Your best bet would be to put the javascript in a seperate galapmap.js file and link to it from the
<head>section in your page.tpl.php file (in your themes folder). Either that or directly in the page.tpl.php file itself so:I think you could put it in the block by choosing full html or php input format, but you won't get the advantage of browser caching etc.
Doesn't work...
I have set the input settings to Full HTML, Php, and even created a new input with no filters, none seem to work. I just end up with an empty block...
If I put it in a seperate js file, what do I include in the file? What is b/t the ? Do I include the actual scripts? And how do I reference to it in the page.tpl file?
I apologize for the dumb questions, but I really don't know how to do it...
Okay Figured it Out
Sorry, I figured it out, it was actually a problem with the coding (which is a little more extensive than what I posted to the forum)...
Thank you for all your help though, it is nice to know this forum exists with so many willing and capable users. I appreciate it.
Want to share?
It would be helpful if you posted your solution for others with the same problem.
Agreed. If you expect help
Agreed.
If you expect help from others, you should also help them in return.
Solution to javascript block
Well, I'm in Drupal6, and I just needed a little javascript snippet in my PHP block. I just wrote the whole javascript (
tags included) in a single PHP command... and voila! working wonders.Since nobody gave an answer yet, I think I'll post one.
I think this is it...
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad...
Would this be of any help to You?
Try this, if you want to insert google adsene fast, and you don't have the technical knowledge required by other suggested methods. It helped me.
Get the your adsene code, something like this:
Then open up your block, and don't just paste the code in there,
click the source button and then paste the code when the widow for the source code opens.
I don't know what editor you may be using, but cck works for me. This may not be a best practice, but its a quick way round some coding that you may not know how to go about.
This does not rule out your use of Content Injector (formerly AdSense Injector)
thanks your comment has
thanks your comment has helped me :)
thanks your comment has
thanks your comment has helped me :)