Skip to content

Instantly share code, notes, and snippets.

View eightyfive's full-sized avatar

0x55 eightyfive

View GitHub Profile
@eightyfive
eightyfive / jquery.data-ajax.js
Last active February 15, 2017 09:32
jQuery [data-ajax] API
$(document).on('click', '[data-ajax]', function (ev) {
var $this = $(this)
var data = $this.data()
var redirect = $this.prop('href') || data.redirect
// `settings` must follows jQuery.ajax API
var settings = data.ajax
ev.preventDefault()
$.ajax(settings).done(function () {
@eightyfive
eightyfive / Lure.js
Last active November 5, 2020 15:02
Lure.js – Tiny Object-Oriented jQuery UI library
(function(root, $) {
var Lure = root.Lure = {};
// ALL credits goes to: backbone.js & marionette.js
Lure.$ = $;
var idCounter = 1;