EPISODE · Feb 1, 2024 · 3 MIN
The basics: hx-vals
from hx-pod · host Lazarus
How do you feel about setting your request values right there inline?STATIC<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='{"location": "01245"}'> Click for weather in one static location</button>DYNAMIC<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='js:{location: document.getElementById("zipcode").value}'> Click for weather in one static location</button>OR<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='js:{location: someJavascriptCalculationFunction()}'> Click for weather in one static location</button>
What this episode covers
How do you feel about setting your request values right there inline?STATIC<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='{"location": "01245"}'> Click for weather in one static location</button>DYNAMIC<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='js:{location: document.getElementById("zipcode").value}'> Click for weather in one static location</button>OR<button hx-get="/my/weather/data" hx-trigger="click" hx-vals='js:{location: someJavascriptCalculationFunction()}'> Click for weather in one static location</button>
NOW PLAYING
The basics: hx-vals
No transcript for this episode yet
Similar Episodes
Mar 14, 2026 ·23m
Mar 11, 2026 ·16m
Feb 28, 2026 ·14m