i am working on a team site inside my SharePoint server 2013. I need to add a Java script code to my master page , so that the script will be available to all my SharePoint web pages. but i can not figure out where i should add the script to my master page ? and should i added it to the Seatle.master or other mater pages . any advice ?
Asked
Active
Viewed 1,295 times
1 Answers
1
Create a JS File und put following line inside the <head> element:
<SharePoint:ScriptLink language="javascript" name="custom.js" runat="server"/>
And yes seattle.master is the right place for it, if you want to run your JS Code on non-administrative pages.
To learn how to provide Custom Javascript files to SharePoint have a look here: more detailed explanation.
http://[host]/Scripts/.But be aware, that other users may access this library.
Another possibility is to place into the file system under
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\.For better management you can create a subfolder here to encapsulate your assets.
– wu5chl Sep 03 '13 at 11:12