Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: edf70f04b0
Fetching contributors…

Cannot retrieve contributors at this time

67 lines (60 sloc) 2.091 kb
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).bind("mobileinit",function(){
$.mobile.jqmRouter={
ajaxApp: true
};
});
</script>
<script type="text/javascript" src="../js/jquery.mobile.router.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
var router=new $.mobile.Router({
"/testAjax.html(?:[?](.*))?": {handler: "ajaxPage", events: "bc,c,bs,s,h"},
"/__subTestAjax.html(?:[?](.*))?": {handler: "ajaxPage", events: "bc,c,i,bs,s,bh,h"},
"/__subTestAjax3.html": {handler: "ajaxPage", events: "rm"}
},{
ajaxPage: function(type,match,ui){
console.log("ajaxPage: "+type+" "+match[0]);
var params=router.getParams(match[1]);
console.log(params);
}
}, {
defaultHandler: function(type, ui, page) {
console.log("Default handler called due to unknown route ("
+ type + ", " + ui + ", " + page + ")");
},
defaultHandlerEvents: "s"
});
setTimeout(function(){
alert("deactivating router...");
router.destroy();
},120000);
</script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Index</h1>
</div>
<div data-role="content">
<p>Index Page</p>
<p>The output of this page can be seen in your javascript console.</p>
<p>
<a href="__subTestAjax.html">Ajax Page</a><br/>
<a href="__subTestAjax.html?foo=bar&bar=foo&testarray[]=foo&testarray[]=bar">
Ajax Page with params
</a><br/>
</p>
</div>
<div data-role="footer">
<h4>Index footer</h4>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.