Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.76 KB

scriptquote-element-view.md

File metadata and controls

61 lines (42 loc) · 1.76 KB
title manager ms.date ms.audience ms.topic ms.localizationpriority api_name api_type ms.assetid description
ScriptQuote element (View)
soliver
3/9/2015
Developer
reference
medium
View schema
schema
ff197349-375c-4bb7-b1c5-2cd54832e4cb
Encodes a string to fit within JavaScript code. This element is used to render text from the server that must be interpreted as a quoted string.

ScriptQuote element (View)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Encodes a string to fit within JavaScript code. This element is used to render text from the server that must be interpreted as a quoted string.

<ScriptQuote
  NotAddingQuote = "TRUE" | "FALSE">
</ScriptQuote>

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
NotAddingQuote
Optional Boolean. TRUE to eliminate quotation marks for enclosing a string. The default value is FALSE.

Child elements

None

Parent elements

Numerous

Occurrences

  • Minimum: 0
  • Maximum: Unbounded

Remarks

The ScriptQuote element performs the following conversions on its body text:

  • Converts " to \"
  • Converts \ to \\
  • Converts CR to \r\CR (where CR is character code 13)

For example, the code <ScriptQuote>This is a test</ScriptQuote> returns "This is a test" because NotAddingQuote is not set to TRUE.

However, the code <ScriptQuote NotAddingQuote="TRUE">This is a test</ScriptQuote> returns This is a test, without quotation marks, because NotAddingQuote is set to TRUE. Note that in the second case, the string is not surrounded by quotation marks.