This file contains hidden or 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
// this is in the process of being rewritten and optimized | |
/** | |
* Copyright (c) 2011 Nick Kwiatek <http://nkwiatek.com> | |
* | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, | |
* copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the |
This file contains hidden or 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
jQuery.fn.outerHtml = function(include_scripts) { | |
if(include_scripts === undefined){ include_scripts = false; } | |
var clone = this.clone(); | |
var items = jQuery.map(clone, function(element){ | |
if(jQuery.nodeName(element, "script")){ | |
if(include_scripts){ | |
var attributes; | |
if(element.attributes){ | |
attributes = jQuery.map(element.attributes, function(attribute){ | |
return attribute.name + '="' + attribute.value + '" '; |