You need to sign in to do that
Don't have an account?
Rakesh Kumar 25
Executing Javascript from Custom Link
I have a piece of Javascript code running fine on a Visualforce Page.The code is referring to a Static resource and it is also working fine.
I need to execute the same JS through custom link ,so that it can be added as a sidebar component on standard pages.
Can someone please suggest what modifications need to be done to the JS so that it can work from Custom Link.
Thanks,
Rakesh
I need to execute the same JS through custom link ,so that it can be added as a sidebar component on standard pages.
Can someone please suggest what modifications need to be done to the JS so that it can work from Custom Link.
Thanks,
Rakesh
Can you please share your code your here if possible?
<script language="JavaScript" type="text/javascript" src="https://cs21.salesforce.com/resource/1426565202000/code_new"></script>
<script language="JavaScript" type="text/javascript">
s.prop1="VAR1" ;
s.prop2="VAR2" ;
s.prop3="" ;
s.prop4="1111111111111" ;
s.prop5="VAR5" ;
var s_code=s.t();if(s_code)document.write(s_code)</script>
<script language="JavaScript" type="text/javascript">
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
</script>
Please remove the script tags from the code to refer the static resources and use{!URLFOR} or {!REQUIRESCRIPT} instead.
Please go through this post:
http://www.interactiveties.com/b_execute_javascript_button.php#.VTqASOH7zKg
Thanks for the suggestion.
I tried the approach as suggested.
It is giving the below error :
"Object does not support property or method 't' ".
This method is availabe in the static resource.
Thanks,
Rakesh