Skip to content

Instantly share code, notes, and snippets.

@schams-net
Forked from helhum/UsingAjaxUrl.html
Last active May 25, 2017 03:52
Show Gist options
  • Save schams-net/b7d9497fa84197a74860e3ccd83794c7 to your computer and use it in GitHub Desktop.
Save schams-net/b7d9497fa84197a74860e3ccd83794c7 to your computer and use it in GitHub Desktop.
Using TS rendering
{namespace t=Helhum\TyposcriptRendering\ViewHelpers}
<button class="ajax-button" data-ajaxUri="{t:uri.ajaxAction(action: 'foo', controller: 'MyController') -> f:format.htmlentities()}">
Click Me
</button>
<script type="text/javascript">
jQuery.ajax(
jQuery(".ajax-button").data("ajaxuri")
).done(
function(result) {
console.log(result);
}
);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment