You need to sign in to do that
Don't have an account?
a contrator
run JavaScript in sidebar
Why my javascript does not work ?
Here is what I tested:
(1) create a custom component 'test' ---type: HTML Area, ticked "show HTML", content: <script> alert('testing....);</script>
(2) add this component to my default home page layout
(3) check "show custom sidebar components on all pages"
(4) click on any TAB, the component only display the name "test" on the sidebar, no javascript running
(5) same thing if the javascript is like
<script>
function init() {
alert("testing...");
}
window.onload = init;
</script>
Any help will be greatly appreciated.
try this approach
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Thanks Chamil.
In your solution, a VF page will be created to handle the javascript which does not meet my needs. What I am going to implement is to hide some button / link in some standard page layout, ex: "add to invitees' in event edit page layout. Using a common JavaScript in a custom home page component is a good resolution as mentioned in this board before. My problem is I don't know why it does not work for me based on my test.
Hi,
where you able to run javascript in a sidebar component?
I'm trying as well, with no luck.
Daniel