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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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.StringA string that contains the JavaScript to encode.
output
Type: System.IO.TextWriterA TextWriter object that represents the output stream in which to append the encoded script.
Remarks
This method escapes the following characters: '"','\'','\\','<','>','+','\n','\r','/','(',')','%','&' and the characters greater than 0x7F.