Skip to content

Commit 326bf16

Browse files
Merge pull request #255276 from bernawy/patch-46
Added breaking change on script tags
2 parents 4230de8 + 9d7f4bd commit 326bf16

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

articles/active-directory-b2c/javascript-and-page-layout.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: CelesteDG
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: how-to
12-
ms.date: 10/26/2022
12+
ms.date: 10/17/2023
1313
ms.custom: project-no-code, devx-track-js, engagement-fy23
1414
ms.author: godonnell
1515
ms.subservice: B2C
@@ -20,7 +20,22 @@ zone_pivot_groups: b2c-policy-type
2020

2121
[!INCLUDE [active-directory-b2c-choose-user-flow-or-custom-policy](../../includes/active-directory-b2c-choose-user-flow-or-custom-policy.md)]
2222

23-
With Azure Active Directory B2C (Azure AD B2C) [HTML templates](customize-ui-with-html.md), you can craft your users' identity experiences. Your HTML templates can contain only certain HTML tags and attributes. Basic HTML tags, such as <b>, <i>, <u>, <h1>, and <hr> are allowed. More advanced tags such as <script>, and <iframe> are removed for security reasons.
23+
With Azure Active Directory B2C (Azure AD B2C) [HTML templates](customize-ui-with-html.md), you can craft your users' identity experiences. Your HTML templates can contain only certain HTML tags and attributes. Basic HTML tags, such as &lt;b&gt;, &lt;i&gt;, &lt;u&gt;, &lt;h1&gt;, and &lt;hr&gt; are allowed. More advanced tags such as &lt;script&gt;, and &lt;iframe&gt; are removed for security reasons but the `<script>` tag should be added in the `<head>` tag.
24+
25+
The `<script>` tag should be added in the `<head>` tag in two ways:
26+
27+
1. Adding the `defer` attribute, which specifies that the script is downloaded in parallel to parsing the page, then the script is executed after the page has finished parsing:
28+
29+
```javascript
30+
<script src="my-script.js" defer></script>
31+
```
32+
33+
34+
2. Adding `async` attribute that specifies that the script is downloaded in parallel to parsing the page, then the script is executed as soon as it is available (before parsing completes):
35+
36+
```javascript
37+
<script src="my-script.js" async></script>
38+
```
2439

2540
To enable JavaScript and advance HTML tags and attributes:
2641

0 commit comments

Comments
 (0)