Friday, August 29, 2014

adding script to specific page by using Location="ScriptLink" in solution

hello everybody


while extending the ribbon there is an option where the new element will be placed:



CommandUIDefinition Location="...

i am using the following code to inject my js functions, where the option to define the scope is missing (i want to load the code just at the pages where the button is available):



<CustomAction Id="ProjectCenterPage.AdditionalScript"
Location="ScriptLink"
ScriptSrc="~SiteCollection/SiteCollectionDocuments/PDPScheduleExtension.js"/>

i do not want to use any additional web parts on the page to perform the injection (like content editor) as far as additional web parts on the project schedule page breaks some functions like sizing (and leads to some more nasty bugs actually).


so is there a way to define the scope where the sript is loaded?


may be there are some other options to inject js code to a page?




Sergey Vdovin


No comments:

Post a Comment