SPHttpUtility.EcmaScriptStringLiteralEncode method (String, TextWriter)

Returns an encoded version of the specified JavaScript and appends it to the specified output stream.

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

Syntax

'Declaration
Public Shared Sub EcmaScriptStringLiteralEncode ( _
    scriptLiteralToEncode As String, _
    output As TextWriter _
)
'Usage
Dim scriptLiteralToEncode As String
Dim output As TextWriterSPHttpUtility.EcmaScriptStringLiteralEncode(scriptLiteralToEncode, _
    output)
public static void EcmaScriptStringLiteralEncode(
    string scriptLiteralToEncode,
    TextWriter output
)

Parameters

  • scriptLiteralToEncode
    Type: System.String

    A string that contains the JavaScript to encode.

Remarks

This method escapes the following characters: '"','\'','\\','<','>','+','\n','\r','/','(',')','%','&' and the characters greater than 0x7F.

See also

Reference

SPHttpUtility class

SPHttpUtility members

EcmaScriptStringLiteralEncode overload

Microsoft.SharePoint.Utilities namespace