hx-vars

注意:hx-vars 已被弃用,取而代之的是 hx-vals,默认情况下更安全。

¥NOTE: hx-vars has been deprecated in favor of hx-vals, which is safer by default.

hx-vars 属性允许你动态添加到将随 AJAX 请求提交的参数。

¥The hx-vars attribute allows you to dynamically add to the parameters that will be submitted with an AJAX request.

此属性的值是用逗号分隔的 name:<expression> 值列表,与 javascript 对象字面量 的内部语法相同。

¥The value of this attribute is a comma separated list of name:<expression> values, the same as the internal syntax of javascript Object Literals.

  <div hx-get="/example" hx-vars="myVar:computeMyVar()">Get Some HTML, Including A Dynamic Value in the Request</div>

安全注意事项

¥Security Considerations

注释

¥Notes