Skip to content

Instantly share code, notes, and snippets.

View pennstatephil's full-sized avatar

Phil Hurwitz pennstatephil

  • Denver, CO
  • 05:42 (UTC -06:00)
View GitHub Profile
@pennstatephil
pennstatephil / initConfirm.js
Last active August 29, 2015 13:57
Use "confirm" attribute on Link/Button to use bootbox confirm window
function initConfirm() {
$("[confirm]:not(.confirmInitialized)").each(function () {
$(this).click(function (e) {
e.preventDefault();
var action = function () { alert("no action"); };
switch ($(this).prop('tagName')) {
case 'A':
var url = $(this).attr("href"),
replaceId = $(this).attr("ajax-replaceTargetId"),
ajaxCompleteFunc = $(this).attr("ajax-complete");