You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,21 @@ On page load, the `include-fragment` element fetches the URL, the response is pa
40
40
41
41
The server must respond with an HTML fragment to replace the `include-fragment` element. It should not contain _another_`include-fragment` element or the server will be polled in an infinite loop.
42
42
43
+
### Other Attributes
44
+
45
+
#### accept
46
+
47
+
This attribute tells `<include-fragment/>` what to send as the `Accept` header, as part of the fetch request. If omitted, or if set to an empty value, the default behaviour will be `text/html`. It is important that the server responds with HTML, but you may wish to change the accept header to help negotiate the right content with the server.
48
+
49
+
#### loading
50
+
51
+
This indicates _when_ the contents should be fetched:
52
+
53
+
-`eager`: Fetches and load the content immediately, regardless of whether or not the `<include-fragment/>` is currently within the visible viewport (this is the default value).
54
+
-`lazy`: Defers fetching and loading the content until the `<include-fragment/>` tag reaches a calculated distance from the viewport. The intent is to avoid the network and storage bandwidth needed to handle the content until it's reasonably certain that it will be needed.
55
+
56
+
The
57
+
43
58
### Errors
44
59
45
60
If the URL fails to load, the `include-fragment` element is left in the page and tagged with an `is-error` CSS class that can be used for styling.
0 commit comments