Permalink
Browse files

Making it clearer we expect text back in the experiments

  • Loading branch information...
1 parent c240828 commit 5314d71a34d1ae176eeb77f61e56c0e3478861ed @jakearchibald committed Dec 4, 2011
Showing with 17 additions and 0 deletions.
  1. +8 −0 experiments/comment-noscript.html
  2. +7 −0 experiments/comment-parsing.html
  3. +2 −0 experiments/noscript-parsing.html
@@ -13,6 +13,14 @@
<script id="dirty">document.write('<' + '!--')</script><noscript>
<img src="http://farm4.staticflickr.com/3251/3037941702_295f176804_s.jpg" alt="A cat, asleep">
</noscript -->
+ <p>Here we attempt to get the text out of a comment.</p>
+ <p>Once we have the markup as text, we can manipulate and parse it.</p>
+ <p>
+ Due to the tricks we're using, the comment's text value will have
+ an extraneous <code>&lt;noscript&gt;</code> at the start and
+ <code>&lt;/noscript</code> at the end. No worries,
+ we can get rid of that later with <code>text.slice(10, -11)</code>.
+ </p>
<script>
window.onload = function() {
var script = document.getElementById('dirty'),
@@ -13,6 +13,13 @@
<script id="dirty">document.write('<' + '!--')</script>
<img src="http://farm4.staticflickr.com/3251/3037941702_295f176804_s.jpg" alt="A cat, asleep">
<!---->
+ <p>Here we attempt to get the text out of a comment.</p>
+ <p>Once we have the markup as text, we can manipulate and parse it.</p>
+ <p>
+ Due to the tricks we're using, the comment's text value will have
+ an extraneous <code>&lt;!--</code> at the end. No worries,
+ we can get rid of that later with <code>text.slice(0, -4)</code>.
+ </p>
<script>
window.onload = function() {
var script = document.getElementById('dirty'),
@@ -13,6 +13,8 @@
<noscript>
<img src="http://farm4.staticflickr.com/3251/3037941702_295f176804_s.jpg" alt="A cat, asleep">
</noscript>
+ <p>Here we attempt to get the text out of a noscript element.</p>
+ <p>Once we have the markup as text, we can manipulate and parse it. Unfortunately this doesn't work in Internet Explorer</p>
<script>
window.onload = function() {
var noscript = document.getElementsByTagName('noscript')[0],

0 comments on commit 5314d71

Please sign in to comment.