Created
March 5, 2010 13:23
-
-
Save phiggins42/322715 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SuperBasic Dojo Page with `plugd`</title> | |
<!-- load dojo from a CDN --> | |
<script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> | |
<!-- load plugd from google SVN server --> | |
<script src="http://plugd.googlecode.com/svn/trunk/base.js"></script> | |
<script> | |
// setup the 'bling' ($) | |
dojo.conflict(); | |
// document is ready for DOM action | |
$(document).ready(function(){ | |
// find the <pre> tag | |
$("#content") | |
// put a notice before that node | |
.addContent("<p>Here is the source of this page:</p>", "before") | |
// pull in window.location content and mangle response data | |
.grab(window.location, { | |
load: function(data){ | |
// so html-entities will print properly: | |
return data.replace(/</g, "<") | |
} | |
}) | |
// make the <pre> tage prettier. should just do this in css though. | |
.style({ | |
backgroundColor:"#ededed", | |
border:"1px solid #666", | |
color:"#101010", | |
padding:"18px" | |
}) | |
; // end of chain | |
// replace the header content: | |
$("#header").addContent("Hello, Dojo", "only"); | |
}); | |
</script> | |
</head> | |
<body> | |
<h1 id="header">Hello, World.</h1> | |
<pre id="content"></pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment