Skip to content

Instantly share code, notes, and snippets.

@evansagge
Created April 6, 2012 22:29
Show Gist options
  • Save evansagge/2323566 to your computer and use it in GitHub Desktop.
Save evansagge/2323566 to your computer and use it in GitHub Desktop.
Loading AJAX content into Twitter Bootstrap modal
$ ->
$("*").on "click", "a[data-toggle=modal]", ->
target = $(@).attr('data-target') || $(@).attr('href')
// ajax-ified only when data-target or href is not an anchor
unless (/^#/).test(target)
$.get target, (html) -> $(html).modal()
false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment