Permalink
Browse files

Adding example

  • Loading branch information...
1 parent c299f93 commit 7760e7101d671e7e329e84f17683236d7a27d9b3 @westonruter committed May 2, 2012
Showing with 33 additions and 0 deletions.
  1. +33 −0 example.xhtml
View
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
+ <head>
+ <meta charset="utf-8" />
+ <title>XHTML document.write() example</title>
+ <script type="text/javascript" src="xhtml-document-write.js"></script>
+ </head>
+ <body>
+ <h1><a href="https://github.com/westonruter/xhtml-document-write">XHTML <code>document.write()</code></a> Example</h1>
+
+ <p>This of course will work when the document is served as either <code>application/xhtml+xml</code>
+ and <code>text/html</code>, as in the case of MSIE.</p>
+
+ <p>To demonstrate handling arbitrary HTML elements with text and comment nodes:</p>
+
+ <blockquote id='arbitrary-html-example'>
+ <script type="text/javascript">
+ document.write("\u003Caddress>This is an \u003Ccode>address\u003C/code> that is \u003Ci>written out\u003C/i>\u003Cbr> using \u003Ccode>document.write()\u003C/code>! \u003C!--Yay!!!-->\u003C/address>");
+
+ document.write("\u003Cul>\u003Cli>First list item");
+ document.write(", here comes some more!\u003C/li>\u003Cli>Second list item\u003C/li>\u003Cli>");
+ document.write("Third list item\u003C/li>\u003C/ul>");
+
+ document.write("\u003Cb style='color:blue'>");
+ document.write('I should be Bold and Blue!');
+ document.write("\u003C/b>");
+ </script>
+ </blockquote>
+
+ <hr />
+ <p>2008-06-05</p>
+ </body>
+</html>

0 comments on commit 7760e71

Please sign in to comment.