Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update README and example

  • Loading branch information...
commit 5249791cb2be5f09a688e65929f22f48390fef35 1 parent b9994ad
@defunkt authored
Showing with 11 additions and 11 deletions.
  1. +9 −11 README.markdown
  2. +2 −0  examples/index.html
View
20 README.markdown
@@ -45,22 +45,20 @@ Oh, the DOM
HTML with JavaScript
--------------------
- $ cat examples/index.html | lyndon
+ $ cat examples/index.html | lyndon
<html><head>
- <title>Lyndon Test!</title>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
- <script>
- $(function() {
- $('#content').append('<div id="hi">Hello world!</div>')
- })
- </script>
- </head><body>
+ <title>It worked!</title>
+ </head><body>
<div id="content">
<div id="hi">Hello world!</div></div>
</body></html>
-
+
Note that the `<div id="hi">Hello world!</div></div>` does _not_ exist
-in `examples/index.html` - it's added at runtime by JavaScript.
+in `examples/index.html` - it's added at runtime by
+JavaScript. JavaScript that strips itself out and changes the
+`<title`>.
+
+Seriously.
With Ruby
View
2  examples/index.html
@@ -6,6 +6,8 @@
<script>
$(function() {
$('#content').append('<div id="hi">Hello world!</div>')
+ $('script').remove()
+ document.title = 'It worked!'
})
</script>
</head>
Please sign in to comment.
Something went wrong with that request. Please try again.