SPHttpUtility.EcmaScriptStringLiteralEncode method (String)

Returns an encoded version of the specified JavaScript.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Shared Function EcmaScriptStringLiteralEncode ( _
    scriptLiteralToEncode As String _
) As String
Dim scriptLiteralToEncode As String
Dim returnValue As String

returnValue = SPHttpUtility.EcmaScriptStringLiteralEncode(scriptLiteralToEncode)
public static string EcmaScriptStringLiteralEncode(
    string scriptLiteralToEncode


  • scriptLiteralToEncode
    Type: System.String

    A string that contains the JavaScript to encode.

Return value

Type: System.String
A string that contains the encoded version of the JavaScript.


Ecma International develops standards for information and communication systems. For more information, see the official Web site for Ecma International at http://www.ecma-international.org/.

See also


SPHttpUtility class

SPHttpUtility members

EcmaScriptStringLiteralEncode overload

Microsoft.SharePoint.Utilities namespace