SP.UserCustomAction.scriptBlock property (sp.js)

Gets or sets the value that specifies the ECMAScript to be executed when the custom action is performed.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value = SP.UserCustomAction.get_scriptBlock ()
var value = SP.UserCustomAction.set_scriptBlock ()

Return value

Type: String

Remarks

It must be null if Location is not "ScriptLink". This Standard defines the ECMAScript scripting language.

REST resource endpoint

See UserCustomAction resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/UserCustomActions(usercustomactionid)/scriptBlock

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/UserCustomActions(usercustomactionid)/scriptBlock

GET syntax

GET http://<sitecollection>/<site>/_api/web/UserCustomActions(usercustomactionid)/scriptBlock