Introduction Sharepoint Using Javascript
JavaScript using in SharePoint runs within the context of the current logged user. It has to be loaded from within a SharePoint artifact / context such as a page or a form. It cannot be executed from outside of SharePoint like CSOM.To add some custom JavaScript functionality, first, create the JavaScript file & add your custom js code.
Sharepoint Using Javascript Job Support
Next, you need to add a reference to the JavaScript location in the page where you want to call this functionality Or, you can also add it to the master page if you want it to be available across all the pages in your site collection.
The Core.Embed JavaScript sample add-in adds a status bar message to all pages on a SharePoint site & removes the new subsite link from the Site Contents page by using JavaScript. Use this solution if you want to apply UI updates to your SharePoint site by using JavaScript instead of creating custom master pages.
JavaScript extends the (OOTB) out of the box capabilities of SharePoint & allows for flexible customization & configuration of SharePoint sites, without making changes to master pages/ the definition of a SharePoint site. An efficient way to add JavaScript to a SharePoint page is using the (CEWP) Content Editor Web Part.The CEWP is a powerful multipurpose (WSS) Windows SharePoint Services Web part that uses a rich text editor for formatted text & hyperlinks and a source editor to store HTML, scripts & custom styles. You can use the source editor of a CEWP to add JavaScript code.