Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed from using outerHTML to innerHTML with a wrapper since Firefo…

…x has no support what so ever for outerHTML.
  • Loading branch information...
commit ac5647085653b2adeb6162061111ff790823faff 1 parent 2eab09e
@remy authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 demos/dataset.html
View
7 demos/dataset.html
@@ -20,7 +20,7 @@
</section>
<p id="status">Not connected</p>
<section>
- <div id="test" data-name="rem" data-height="short">This element has data</div>
+ <div id="testWrapper"><div id="test" data-name="rem" data-height="short">This element has data</div></div>
<input type="button" value="Show data" id="show" />
<input type="button" value="Change data via dataset" id="change1" />
<input type="button" value="change data via setAttribute" id="change2" />
@@ -31,7 +31,7 @@
(function () {
function show() {
- code.innerHTML = test.outerHTML.replace(/[<>]/g, function (m) {
+ code.innerHTML = testWrapper.innerHTML.replace(/[<>]/g, function (m) {
return { '<': '&lt;', '>': '&gt;' }[m];
});
@@ -43,7 +43,8 @@
var state = document.getElementById('status'),
code = document.getElementById('element');
-var test = window.element = document.getElementById('test');
+var test = document.getElementById('test'),
+ testWrapper = document.getElementById('testWrapper');
if (test.dataset === undefined) {
state.innerHTML = 'dataset not supported';
Please sign in to comment.
Something went wrong with that request. Please try again.