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
`$()` throws when no matching element is found. To avoid this behavior, use `$.optional()`:
52
+
`$()` throws when no matching element is found. To handle undefined values, use `$.optional()`:
53
53
54
54
```astro
55
55
---
@@ -87,7 +87,7 @@ ready(() => {
87
87
</script>
88
88
```
89
89
90
-
##Global`$.ready()` function
90
+
###`$.ready()` function
91
91
92
92
All `$` queries must be nested in a `$.ready()` block. This opts in to using the global `$` from client scripts. `$.ready()` also ensures your code reruns on every page [when view transitions are enabled.](https://docs.astro.build/en/guides/view-transitions/)
`$()` throws when no matching element is found. To avoid this behavior, use `$.optional()`:
55
+
`$()` throws when no matching element is found. To handle undefined values, use `$.optional()`:
56
56
57
57
```astro
58
58
---
@@ -90,7 +90,7 @@ ready(() => {
90
90
</script>
91
91
```
92
92
93
-
## Global `$.ready()` function
93
+
## `$.ready()` function
94
94
95
95
All `$` queries must be nested in a `$.ready()` block. This opts in to using the global `$` from client scripts. `$.ready()` also ensures your code reruns on every page [when view transitions are enabled.](https://docs.astro.build/en/guides/view-transitions/)
0 commit comments