Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to Include JS file already available in SharePoint Site(Style Library) in Command action

$
0
0

I have included JS file in command Action Using below command 

 <CommandUIHandlers>
        <CommandUIHandler
          Command="EnableCustomGroup"
          CommandAction="javascript:return true;" />
        <CommandUIHandler
          Command="CustomGroupHelloWorld"
          CommandAction="javascript:openPopup();" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
  <CustomAction Id="Ribbon.Library.Actions.Scripts"
 Location ="ScriptLink"
 ScriptSrc="/_layouts/15/images/Scripts/Popup.js" /> 

It was working fine now I am embeding my project to Development Project in which we have divided the Modules in to two different projects One project with all Branding work including all CSS and JS files (including the above Popup.JS file) which once deployed and the js file is residing in Style Library. 

The Second project has the Command Action to call the JS file which is already residing in Site (Style Library) I am unable to refer that file path I tried using "/Style Library...... Popup.js" and also the full URL "http://site collection/style Library/... Popup.js" just to make sure if it is working or not. But it is throwing error saying file is not found. Can anyone help me how to refer the file what source URL should i give. Thanks in Advance

Thanks and Regards,


Raj Kamal Singh Rathore



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>