From 66840d0d568dc664f9f7c8228c20d90c7566ab2d Mon Sep 17 00:00:00 2001 From: CC2m2 <61456600+CC2m2@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:25:49 +0800 Subject: Update index.html --- files/zh-cn/web/javascript/reference/template_literals/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/javascript/reference/template_literals/index.html b/files/zh-cn/web/javascript/reference/template_literals/index.html index 33fb6ebe53..e16b62d850 100644 --- a/files/zh-cn/web/javascript/reference/template_literals/index.html +++ b/files/zh-cn/web/javascript/reference/template_literals/index.html @@ -171,13 +171,13 @@ tag`string text line 1 \n string text line 2`;

另外,使用{{jsxref("String.raw()")}} 方法创建原始字符串和使用默认模板函数和字符串连接创建是一样的。

var str = String.raw`Hi\n${2+3}!`;
-// "Hi\n5!"
+// "Hi\\n5!"
 
 str.length;
 // 6
 
 str.split('').join(',');
-// "H,i,\,n,5,!"
+// "H,i,\\,n,5,!"
 

带标签的模版字面量及转义序列

-- cgit v1.2.3-54-g00ecf From 9ceaac7aeac286b2795f31fbd1cd3d03258aad7c Mon Sep 17 00:00:00 2001 From: CC2m2 <61456600+CC2m2@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:15:59 +0800 Subject: Update index.html --- .../web/javascript/reference/global_objects/string/raw/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html index 8ff8794000..989a78f2c6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html @@ -55,10 +55,10 @@ String.raw`templateString`

使用 String.raw()

String.raw`Hi\n${2+3}!`;
-// 'Hi\n5!',Hi 后面的字符不是换行符,\ 和 n 是两个不同的字符
+// 'Hi\\n5!',Hi 后面的字符不是换行符,\ 和 n 是两个不同的字符
 
 String.raw `Hi\u000A!`;
-// "Hi\u000A!",同上,这里得到的会是 \、u、0、0、0、A 6个字符,
+// "Hi\\u000A!",同上,这里得到的会是 \、u、0、0、0、A 6个字符,
 // 任何类型的转义形式都会失效,保留原样输出,不信你试试.length
 
 let name = "Bob";
-- 
cgit v1.2.3-54-g00ecf


From a50b6c45ca90dbed6bf615a3d34b3d5b440239f1 Mon Sep 17 00:00:00 2001
From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com>
Date: Sat, 4 Sep 2021 15:56:54 +0100
Subject: Fix a typo in Web/API/HTMLCanvasElement/getContext, zh-CN (#2315)

fix #1156
---
 files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'files/zh-cn/web')

diff --git a/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html b/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html
index 07c0e6820c..b33d9bf95c 100644
--- a/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html
+++ b/files/zh-cn/web/api/htmlcanvaselement/getcontext/index.html
@@ -78,7 +78,7 @@ var ctx = canvas.getContext(contextType, contextA
    
   
   
  • -

    premultipliedAlpha: 表明排版引擎讲假设绘制缓冲区包含预混合alpha通道的{{jsxref("boolean")}}值。

    +

    premultipliedAlpha: 表明排版引擎将假设绘制缓冲区包含预混合alpha通道的{{jsxref("boolean")}}值。

  • preserveDrawingBuffer: 如果这个值为{{jsxref("true")}}缓冲区将不会被清除,会保存下来,直到被清除或被使用者覆盖。

    -- cgit v1.2.3-54-g00ecf From 0c98a8a92bcdfddae7fcf277659f59085351d644 Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 16:06:59 +0100 Subject: Fix example link in Web/JavaScript/Reference/Global_Objects/Object/seal, zh-CN (#2317) fix #106 --- .../web/javascript/reference/global_objects/object/seal/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html index 7a18ee2e91..6fd23f3d1d 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html @@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/seal
    -
    {{EmbedInteractiveExample("pages/js/object-prototype-seal.html")}}
    +
    {{EmbedInteractiveExample("pages/js/object-seal.html")}}
    -- cgit v1.2.3-54-g00ecf From 40fcb5319c8bc7b2710f9f5ab13816ffaa39631c Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 16:22:27 +0100 Subject: Fix html table in Web/CSS/transform-function/rotate3d(), zh-CN (#2322) --- .../web/css/transform-function/rotate3d()/index.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/css/transform-function/rotate3d()/index.html b/files/zh-cn/web/css/transform-function/rotate3d()/index.html index 9eea1570ba..f9e046f02b 100644 --- a/files/zh-cn/web/css/transform-function/rotate3d()/index.html +++ b/files/zh-cn/web/css/transform-function/rotate3d()/index.html @@ -38,18 +38,20 @@ translation_of: Web/CSS/transform-function/rotate3d() - + - - - - + + + + + - - - + + + + -- cgit v1.2.3-54-g00ecf From 9fc2dfcce134d40437620b5b63e09ca2b397f720 Mon Sep 17 00:00:00 2001 From: Robert Zhao <52877222+zhao-robert@users.noreply.github.com> Date: Sat, 4 Sep 2021 23:55:16 +0800 Subject: Add Web/API/Navigator/language, zh-CN (#2327) * add zh-cn/web/api/navigator/language * Update zh-cn/web/api/navigator/language Modify an incorrectly used period. * add spaces to web/api/navigator/language --- files/zh-cn/web/api/navigator/language/index.html | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 files/zh-cn/web/api/navigator/language/index.html (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/api/navigator/language/index.html b/files/zh-cn/web/api/navigator/language/index.html new file mode 100644 index 0000000000..a4e3508ec7 --- /dev/null +++ b/files/zh-cn/web/api/navigator/language/index.html @@ -0,0 +1,50 @@ +--- +title: Navigator.language +slug: Web/API/Navigator/language +tags: + - API + - Language + - Navigator + - Property + - Read-only + - Reference +browser-compat: api.Navigator.language +translation_of: Web/API/Navigator/language +--- +
    {{APIRef("HTML DOM")}}
    + +

    Navigator.language 为只读属性,返回一个表示用户偏好语言(通常是浏览器界面语言)的字符串。

    + +

    语法

    + +
    const lang = navigator.language
    +
    + +

    + +

    一个 {{domxref("DOMString")}}。lang存储了一个在 BCP 47 中定义的语言版本。一些有效的语言版本代码示例包括: “en”、“en-US”、“fr”、“fr-FR”、“es-ES” 等。

    + +

    请注意,在 iOS 10.2 之前的 Safari 中,返回的语言版本代码是小写的: “en-us”、“fr-fr” 等。

    + +

    示例

    + +
    if (/^en\b/.test(navigator.language)) {
    +  doLangSelect(window.navigator.language);
    +}
    +
    + +

    规格

    + +{{Specifications}} + +

    浏览器兼容性

    + +

    {{Compat}}

    + +

    更多参见

    + +
      +
    • {{domxref("navigator.languages")}}
    • +
    • {{domxref("navigator")}}
    • +
    -- cgit v1.2.3-54-g00ecf From ef22c6b7659e5df135eb68f05a2e2e93f7dcb8a5 Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 20:06:04 +0100 Subject: Fix syntax highlight in Web/API/URL/searchParams, zh-CN (#2319) * add syntax highlight * remove duplicate tag --- files/zh-cn/web/api/url/searchparams/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/api/url/searchparams/index.html b/files/zh-cn/web/api/url/searchparams/index.html index d4d775aed0..f782dc15c4 100644 --- a/files/zh-cn/web/api/url/searchparams/index.html +++ b/files/zh-cn/web/api/url/searchparams/index.html @@ -18,7 +18,7 @@ translation_of: Web/API/URL/searchParams

    语法

    -
    const urlSearchParams = url.searchParams
    +
    const urlSearchParams = url.searchParams

    属性值

    -- cgit v1.2.3-54-g00ecf From 5394433d6158422292de835dbcc55e75821bbe7b Mon Sep 17 00:00:00 2001 From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com> Date: Sat, 4 Sep 2021 20:08:01 +0100 Subject: Fix example code in Web/API/URL/searchParams, zh-CN (#2320) * fix #150 * Update index.html --- files/zh-cn/web/api/url/searchparams/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/zh-cn/web') diff --git a/files/zh-cn/web/api/url/searchparams/index.html b/files/zh-cn/web/api/url/searchparams/index.html index f782dc15c4..a3ac04aded 100644 --- a/files/zh-cn/web/api/url/searchparams/index.html +++ b/files/zh-cn/web/api/url/searchparams/index.html @@ -26,7 +26,7 @@ translation_of: Web/API/URL/searchParams

    例子

    -

    如果你的 URL 是 https://example.com/?name=Jonathan&age=18 ,你可以这样解析 URL,然后得到 nameage 的值。

    +

    如果你的 URL 是 https://example.com/?name=Jonathan%20Smith&age=18 ,你可以这样解析 URL,然后得到 nameage 的值。

    let params = (new URL(document.location)).searchParams;
     let name = params.get('name'); // is the string "Jonathan Smith".
    -- 
    cgit v1.2.3-54-g00ecf
    
    
    笛卡尔坐标 on ℝ2齐次坐标 on ℝℙ2笛卡尔坐标 on ℝ3齐次坐标 on ℝℙ3在ℝ2上的笛卡尔坐标这种变换应用于3D空间,不可用于平面空间
    在ℝℙ2上的齐次坐标
    这种变换应用于3D空间,不可用于平面空间在ℝ3上的笛卡尔坐标 1+(1-cos(a))(x2-1)z·sin(a)+xy(1-cos(a))-y·sin(a)+xz·(1-cos(a))-z·sin(a)+xy·(1-cos(a))1+(1-cos(a))(y2-1)x·sin(a)+yz·(1-cos(a))ysin(a) + xz(1-cos(a))-xsin(a)+yz(1-cos(a))1+(1-cos(a))(z2-1)t0001
    在ℝℙ3上的齐次坐标