Skip to content

Instantly share code, notes, and snippets.

@ericf
Created July 5, 2012 18:19
Show Gist options
  • Select an option

  • Save ericf/3055477 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/3055477 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>App Root Test</title>
</head>
<body>
<h1>App Root Test</h1>
<script src="http://yui.yahooapis.com/3.6.0pr2/build/yui/yui-min.js"></script>
<script>
YUI({combine: false, filter: 'raw'}).use('app-base', function (Y) {
var app = new Y.App({
serverRouting: false,
root : '/app-root-test/',
routes: [
{path: '/:id/*', callback: 'handleId'}
]
});
app.handleId = function (req) {
alert(req.params.id);
};
app.render().dispatch();
// Expose so you can navigate the app via the console.
window.app = app;
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment