5
<title>Controller Test</title>
9
<textarea id="log" cols="80" rows="10"></textarea>
12
<button id="push">pushState</button>
13
<a href="http://www.yahoo.com/">Yahoo!</a>
16
<script src="http://platypus-lan:3000/build/yui/yui.js"></script>
18
document.getElementById('log').value = '';
20
var Y = YUI({filter: 'raw',}).use('controller', 'node', function (Y) {
21
var logEl = document.getElementById('log'),
22
controller = new Y.Controller();
24
controller.route('/*anything', function (req) {
25
log('route called, path: ' + req.path);
28
controller.dispatch();
30
function log(message) {
31
logEl.value += message + '\n';
34
Y.one('#push').on('click', function () {
35
controller.save('/' + Y.Lang.now());