Skip to content

Instantly share code, notes, and snippets.

@georgebyte
Last active October 5, 2023 10:28
Show Gist options
  • Save georgebyte/9420858 to your computer and use it in GitHub Desktop.
Save georgebyte/9420858 to your computer and use it in GitHub Desktop.
HTML5, jQuery: JSON in data attribute
HTML:
<a href="#" data-lang-string='{"show":"{{ Lang::get('header.show_menu') }}", "hide":"{{ Lang::get('header.hide_menu') }}"}' id="toggle_navigation">{{ Lang::get('header.show_menu') }}</a>
JAVASCRIPT:
$("#toggle_navigation").data('lang-string').show;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment