Skip to content

Instantly share code, notes, and snippets.

View gigi81's full-sized avatar

Luigi Grilli gigi81

View GitHub Profile
@gigi81
gigi81 / jquery-ui.unobtrusive.js
Last active September 29, 2015 12:38
jQuery UI unobtrusive
(function ($) {
var createWidgets = function ($el) {
var data = $el.attr('data-jqueryui');
var widget = data, options = null, index = data.indexOf(':');
if (index > 0) {
widget = data.substr(0, index);
eval("options = " + data.substr(index + 1).trim());
}
// Sanity check: can't directly check that it's truly a _widget_, but