Permalink
Browse files

Edited examples.html via GitHub

  • Loading branch information...
1 parent 9a010e4 commit b6620de66c93b0bbfa3f59ab8f3cf382b9d3dcc6 @eprochasson eprochasson committed Apr 29, 2011
Showing with 20 additions and 17 deletions.
  1. +20 −17 examples.html
View
@@ -6,30 +6,33 @@
<script type="text/javascript" src="lib/weld.js"></script>
<script type="text/javascript">
window.onload = function() {
- // We eat our own dogfood.
- // This entire page is rendered via weld.
- var page = {
- pageTitle : "Weld examples",
- description : "Below is a list of examples",
- dogfood : "This page was rendered with weld",
- example : [
- {
- title : 'Render an object into some elements',
- markup : '<div id="example-1">\n <h1 class="title">Bunk data</h1>\n <p class="body">Bunk description</p>\n</div>',
- data : '{"title" : "My first blog post!", "body" : "Hello world!"}',
- code : 'weld(document.getElementById("example-1"), data)'
- }
- ]};
- weld(document.body, page);
+
+ var getWeld = function(){
+
+ // We eat our own dogfood.
+ // This entire page is rendered via weld.
+ var page = {
+ pageTitle : "Weld examples",
+ description : "Below is a list of examples",
+ dogfood : "This page was rendered with weld",
+ example : [
+ {
+ title : 'Render an object into some elements',
+ markup : '<div id="example-1">\n <h1 class="title">Bunk data</h1>\n <p class="body">Bunk description</p>\n</div>',
+ data : '{"title" : "My first blog post!", "body" : "Hello world!"}',
+ code : 'weld(document.getElementById("example-1"), data)'
+ }
+ ]};
+ weld(document.body, page);
+ };
var actionElements = document.getElementsByClassName('action'),
currentActionElement = actionElements.length;
// setup the onclick for all of the "weld!" links
while(currentActionElement--) {
actionElements[currentActionElement].onclick = function(e) {
-
- return false;
+ getWeld();
}
}
};

0 comments on commit b6620de

Please sign in to comment.