-
-
Save enix-app/61d247e6b5250de0334604187eb80172 to your computer and use it in GitHub Desktop.
An implementation of $.getScript but for stylesheets. Call it $.getStylesheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.getStylesheet = function (href) { | |
var $d = $.Deferred(); | |
var $link = $('<link/>', { | |
rel: 'stylesheet', | |
type: 'text/css', | |
href: href | |
}).appendTo('head'); | |
$d.resolve($link); | |
return $d.promise(); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment