💻 Client-side Rendering Demo
This page demonstrates client-side JavaScript functionality in Astro with <script> tag.
ℹ️ Information
Counter: (Increments at runtime as JS is bundled with client side html and runs in browser, see console log in browser)
Time: Updates at runtime due to client side JS
Rendering Mode: Client Side Rendering
When Generated: At build time, JS is bundled at build time and executes in browser
Performance: Fastest - served as static HTML (All client-side JavaScript is automatically stripped out)
ℹ️ About Client-side JavaScript in Astro
- Script tags: Regular JavaScript works in Astro pages
- No build step required: Write vanilla JavaScript directly
- Module scripts: Use ES6 modules with
<script type="module"> - Framework components: Use React/Svelte/Vue for complex interactions
- Progressive enhancement: Start with HTML, add JavaScript as needed