I have a custom action that look like this :
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="MyCustomAction" Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
...
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="MyCommand"
CommandAction="javascript:alert('Hello World!');" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
How can I move the alert('Hello World!');
JavaScript code from the custom action definition to a dedicated MyScript.js
file ? (in the _layout
folder or any other place)