Skip to content

Commit e2ed7ec

Browse files
committed
Document how src attribute initiates server fetch
1 parent 1f90b2d commit e2ed7ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ Attribute | Options | Description
6868
--- | --- | ---
6969
`src` | URL string | Required URL from which to load the replacement HTML element fragment.
7070

71+
72+
### Deferred loading
73+
74+
The request for replacement markup from the server starts when the `src` attribute becomes available on the `<include-fragment>` element. Most often this will happen at page load when the element is rendered. However, if we omit the `src` attribute until some later time, we can defer loading the content at all.
75+
76+
The [`<details-menu>`][menu] element uses this technique to defer loading menu content until the menu is first opened.
77+
78+
[menu]: https://github.com/github/details-menu-element
79+
7180
## Patterns
7281

7382
Deferring the display of markup is typically done in the following usage patterns.

0 commit comments

Comments
 (0)