共用方式為


SPHttpUtility.EcmaScriptStringLiteralEncode method (String, TextWriter)

傳回指定的JavaScript編碼的版本,並將它附加至指定的輸出資料流。

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

Syntax

'宣告
Public Shared Sub EcmaScriptStringLiteralEncode ( _
    scriptLiteralToEncode As String, _
    output As TextWriter _
)
'用途
Dim scriptLiteralToEncode As String
Dim output As TextWriterSPHttpUtility.EcmaScriptStringLiteralEncode(scriptLiteralToEncode, _
    output)
public static void EcmaScriptStringLiteralEncode(
    string scriptLiteralToEncode,
    TextWriter output
)

參數

  • scriptLiteralToEncode
    Type: System.String

    字串,包含要編碼的JavaScript 。

備註

這個方法逸出下列字元: '' ',' \ '' \\'、 '< ',' >','+' '\n','\r','/','(',')' '%'、 '&' 和大於 0x7F 字元。

請參閱

參照

SPHttpUtility class

SPHttpUtility members

EcmaScriptStringLiteralEncode overload

Microsoft.SharePoint.Utilities namespace