javascript - Pass database variables to jQuery via element attribute? -
is there specification "pass database variables jquery via element attribute?"
i've been doing long time:
<script> var status = <%= status %>; </script> i rather this:
<variable data-name="status" data-value="<%= status %>" /> then jquery:
var status = $('variable[data-name="status"]').attr("data-value"); i need element hidden displaying. know there pattern this, don't know it's called or how search it.
have tried:
<input type="hidden" data-name="status" data-value="<%= status %>" />
Comments
Post a Comment