-
-
Save jorik041/5843955 to your computer and use it in GitHub Desktop.
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
$.fn.extend({ | |
// ---- HTML Comments ---- // | |
comments: function() { | |
return $(this).contents() | |
.filter(function() { | |
return this.nodeType == 8; | |
}); | |
}, | |
// ---- Outer HTML ---- // | |
outerHtml: function() { | |
return $(this).clone().wrap('<div>').parent().html(); | |
} | |
}); | |
$.extend({ | |
// ---- Quick URL Parsing ---- // | |
parseUrl: function(url) { | |
var parser = document.createElement('a'); | |
parser.href = url; | |
return parser; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment