By sunilkataria on
I had a problem adding java script in block. Drupal does not parse google ads script in block, if any one can tell me how could i add javascript in my blocks
I had a problem adding java script in block. Drupal does not parse google ads script in block, if any one can tell me how could i add javascript in my blocks
Comments
Filters
If you create an input type that allows all code, you can then use that for your js block. You probably will want to limit the permissions of this unrestricted input type to admin user only. Go to administer/input formats, and add a new input format. Then configure it and disable the html filter. I think this should do it for you.
--
mediagirl.org
It doesn't work
It doesn't seems to be working in my case
Use the PHP filter type.
Use the PHP filter type.
Hey, Yeah I am having a
Hey,
Yeah I am having a similar problem.
I would like to be able to add simily a windows media player 10 script:
Of course ignore the 1s in the code. lol Had to do that to post it. ;)
But it does not work. So how can I get it to work. This is the only javascript giving me problems. Others I use work fine.
Know the code is good since it works fine on my own pc.
Thanks,
Will
uncomment the code
Will, something I learned this morning was that drupal ignores anything that's commented out and thus doesn't pass it to the browser. Take the
<!-- //-->out and just leave in
Yes, i know it's bad form, but it might be worth a shot.
Use PHP filter
That's the simplest way. I have ad sense block in my website. It works well.
--------------------------
http://www.kzeng.info
didn't work
Kzeng, I tried your suggestion but it's not working. I also wanted to let you know that I took a look at your site and the google ads weren't showing there either.
small discovery
I've been playing with this for the last few minutes. It seems if the javascript is in the block, everything works fine. However, if the javascript is referenced such as
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Then it is ignored for some reason. Anyone have any guess as to why this is?
Full HTML filter as delivered
Full HTML filter as delivered converts /n to <br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"/>
</script/>
will be converted to
<script type="text/javascript"<br />src="http://pagead2.googlesyndication.com/pagead/show_ads.js"/><br/></script/>
Do you know how to configure the input formats? I've changed my Full HTML filter to a no-op.
i must be overlooking something
I've changed my Full HTML input format to not filter anything. I did notice something new, though. When looking at the source code of the finished page, the script reference isn't even showing up. The first part of the google code appears (once I uncommented it) but not the second part that I made reference to above. It makes no sense to me. Can anyone suggest something that I may have over looked or something?