By flipe on
Hello,
I would like to include a Javascript code in a block.
First a Javascript function definition:
--scrit--... --scrit--
then --a href=\'javascrit:...--- call
Which would be the best way to do it? That is, ensuring security in the whole site and avoidng Javascript restrictions in that block.
Thank you!
Comments
It would seem all you need is a php block...
... then just echo the href
unless I am misunderstanding this, or you've already tried and it didn't work...
I'm assuming that for some reason just putting what you want in your custom block isn't working?
If this doesn't help you solve your problem, could you add a little more detail about what you've already tried and why it didn't work/what the error was? That would give us some more insight into your situation.
...and could someone else explain why the word javascript is filtered within a
<code>tag? Doesn't it all get rendered inert in a code block anyway? Just curious...Thanks
~Tat~
Input Format
Just create a new input format and set it as unfiltered.
Create a block and assign it the unfiltered format and you'll be set. Be sure to set the permissions on who you want to allow this format, too.
Solved!
It was quite easy this way... Thank you!
Yup
No problem. Glad it worked for you.
Don't forget to surround it with code tags still
Don't forget to surround it in code tags or it still won't work: e.g.