String.prototype.quote()

廃止 Gecko 37 (Firefox 37 / Thunderbird 37 / SeaMonkey 2.34)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

非標準
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

概要

特殊文字をエスケープシーケンスで置換しダブル・クォーテーション(")でラップした文字列のコピーを返します。

構文

str.quote()

str str.quote() eval( str.quote() )
Hello world! "Hello world!" Hello world!
Hello
        world!
"Hello\n\tworld!" Hello
        world!
" \ — ' "\" \\ \u2014 '" " \ — '

関連情報

ドキュメントのタグと貢献者

 このページの貢献者: teoli, ethertank
 最終更新者: teoli,