Questions tagged [scriptlink]

ScriptLink is a class of the Microsoft.SharePoint.WebControls namespace that provides properties and methods for registering resources, such as scripts, on a page so that they can be requested when the page is rendered.

Filter by
Sorted by
Tagged with
2 votes
0 answers
224 views

What means OnDemand, LoadAfterUI, Localizable attributes in SharePoint:ScriptLink tag?

I'm developing simple sharepoint hosted app. on app's default.aspx i see the below scriptlink tag. but i do not understand the need of OnDemand, LoadAfterUI, Localizable attributes. <SharePoint:...
user avatar
  • 405
1 vote
2 answers
906 views

Set a ribbon user custom action using PowerShell

How to fully defined and add a user custom action using PowerShell. I was able to define and add a custom action but I don't know how to point to a JS file that contains the JavaScript I would like to ...
user avatar
2 votes
2 answers
791 views

Adding jQuery to Seattle masterpage

I'm trying to add jquery to my Seattle masterpage. I followed these directions which say to add the following (modified for my locations) line to the Seattle.html file. <!--SPM:<SharePoint:...
user avatar
  • 2,959
1 vote
1 answer
1k views

Order of js scripts added by ScriptLink control and CustomAction

In our team we have a convention that common use js libraries, for example jQuery, are registered somehow in website, so in custom web parts we shouldn't register it again. In one website jQuery is ...
user avatar
3 votes
2 answers
3k views

How to force my custom SharePoint:Scriptlink to run as the last script inside my page layout

I am working on an enterprise wiki .aspx page layout. and i added the following script inside my page layout:- <SharePoint:Scriptlink runat="server" Name="~sitecollection/Resources/PageLayout.js" ...
user avatar
  • 972
0 votes
2 answers
716 views

CannotMakeBrowserCacheSafeLayoutsUrl for ScriptLink in CustomAction

I'm trying to reference a JS file in (multiple) site-collections by using a Custom Action with Location=ScriptLink as described by sadomovalex. Referencing the file in the site-collection where the ...
user avatar
  • 162
0 votes
2 answers
680 views

Embed Javascript for a site collection in SPO

What is best practice to embed javascript for an SPO site collection? I was hoping to run the OfficeDev/PnP Core.EmbedJavaScript but it requires side loading of apps. I'm looking for a ...
user avatar
0 votes
1 answer
83 views

Specify a Root Path of hosted app for script links in SharePoint hosted app?

I'm writing script reference in custom master page, and don't want to change the scripts for subfolder pages. Is there a way to make the path relative to the root directory? for example: <link ...
user avatar
1 vote
1 answer
724 views

CSR: ScriptLink/Custom Action CDN Libraries load after JSLinked files are loaded

I am almost to 2.0 with the generic iCSR support library. Having some issues with deployment: Adding the library as SiteCollection ScriptLink/Custom action loads it before msajaxbundle where Type....
user avatar
0 votes
0 answers
117 views

Sharepoint 2013 - replacing links in Picture Slideshow

I'm using SP2013. The links in the OOTB Picture slideshow link directly to the image. I need to change the array that is default with some sort of script (which I'm not great with). I did find this ...
user avatar
  • 579
4 votes
2 answers
2k views

Unable to Unregister UserCustomActions added at location scriptlink using CSOM

Below code was used to add Custom action to site <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="_layouts/15/sp.js"><...
user avatar
1 vote
2 answers
686 views

Can ScriptLink load a remote file?

When I try to load a remote file through ScriptLink it doesn't work. <!--SPM:<SharePoint:ScriptLink ID="ScriptReg2" language="javascript" name="https://somesite.blob.core.windows.net/scripts/my-...
user avatar
  • 1,295
0 votes
2 answers
5k views

SharePoint Online Plan 1 and jQuery

I'm working on a SharePoint Online Plan 1 Site Collection in preparation for our Office 365 deployment and I'm getting a lot of requests for small UI changes and tweaks (make certain Library Columns ...
user avatar
2 votes
1 answer
483 views

How to create webpart page using ECMA Script

I have tried to create webpart page using ECMA script, but did not get the right solution. Example : I have created two text-boxes one for "page name" ,second for "web-part name". when user click on ...
user avatar
1 vote
1 answer
210 views

Referencing JS in master page: Using MS and ME tags versus not using them

I've seen scripts referenced in 2 ways. What is the purpose of the MS and ME tags? Use them or not? <!–MS:<SharePoint:ScriptLink ID=”ScriptLink21″ Name=”sp.js” runat=”server” OnDemand=”false” ...
user avatar
  • 319
1 vote
1 answer
742 views

Script file file not being loaded through ScriptLink custom action - SharePoint app

I am having trouble with script link custom actions. I am building a SharePoint app, and I successfully added a site-scope custom action pointing to a script file in the Style Library, as I want this ...
user avatar
  • 171
14 votes
2 answers
27k views

When to use scriptlink, scriptblock and script

I have seen an application page where the developer using scriptlink, and below that just , I was wondering when would each one be used?
user avatar
2 votes
2 answers
1k views

JavaScript error while added jquery library to standard teamsite

I have a standard SharePoint 2013 Teamsite template with "seattle" masterpage and added jquery in the head of the seattle.html to solve some branding issues(screen 1). The problem is that I always get ...
user avatar
  • 449
3 votes
1 answer
2k views

Reference JScript files at the end of page using ScriptLink Tag

Due to performance problems, we decided to reference javascript files at the end of the master page file. However, if we reference javascript files at the end of master page using ScriptLink Tag, the ...
user avatar
  • 171
2 votes
1 answer
1k views

Load page error when I use ScriptLink in the page head

Here is the beginning of my custom SharePoint Application Page: <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, ...
user avatar
  • 1,410