require([ 'dojo/hash', 'dojo/parser', 'rft/app/Content', 'rft/app/Page', 'rft/pages/viewSurvey', 'dojo/domReady!', 'rft/stddeps' ],function(hash,parser,Content,Page,viewSurvey) { parser.parse(); Content.startup(); var match = /^!\/(\w+)$/g.exec(hash()); if ( !match ) { Content.set(new Page({ templateString: "
Something is wrong with the URL, don't know what survey to show you. Sorry.
" })); return; } var surveyId = match[1]; // read options from hash/url // // authenticate Content.set(new viewSurvey({ surveyId: surveyId })); });