diff --git a/core/js/compatibility.js b/core/js/compatibility.js
index cc37949409d3585e2acb3f1e49b38652ed053d60..b690803ca7727c9214b8bc788d480afb4afd551d 100644
--- a/core/js/compatibility.js
+++ b/core/js/compatibility.js
@@ -133,4 +133,18 @@ if(!String.prototype.trim) {
 	String.prototype.trim = function () {
 		return this.replace(/^\s+|\s+$/g,'');
 	};
-}
\ No newline at end of file
+}
+
+// Older Firefoxes doesn't support outerHTML
+// From http://stackoverflow.com/questions/1700870/how-do-i-do-outerhtml-in-firefox#answer-3819589
+function outerHTML(node){
+	// In newer browsers use the internal property otherwise build a wrapper.
+	return node.outerHTML || (
+	function(n){
+		var div = document.createElement('div'), h;
+		div.appendChild( n.cloneNode(true) );
+		h = div.innerHTML;
+		div = null;
+		return h;
+	})(node);
+}
diff --git a/core/js/octemplate.js b/core/js/octemplate.js
index a5d56852a5754c6e40fb4e483ba8914c599f9092..e032506c0b1b3c93f5d3a116a868fe2d581d02bf 100644
--- a/core/js/octemplate.js
+++ b/core/js/octemplate.js
@@ -72,7 +72,7 @@
 		},
 		// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
 		_build: function(o){
-			var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML;
+			var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : outerHTML(this.elem.get(0));
 			try {
 				return data.replace(/{([^{}]*)}/g,
 					function (a, b) {