Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (44 sloc) 1.75 KB
<!DOCTYPE html>
<title>Page Title</title>
<link rel="stylesheet" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="../js/"></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var router=new $.mobile.Router([
{ "#index": {
handler: function(type){
console.log("Index has been "+(type=="pagehide"?"hidden":"shown"));
}, events: "h,s" }
{ "externalUrl(?:[?/](.*))?": {handler: "testBL", events: "bl" } }
testBL: function(type,match,data,scope,e){
console.log("document event! "+type);
var page=$('<div data-role="page"><div data-role="header"><h1>title</h1></div><div data-role="content">page4content<a data-role="button" href="#index">back to index</a></div></div>').appendTo("body");
data.deferred.resolve(data.absUrl, data.options, page );
}, { ajaxApp: true });
<div data-role="page" id="index">
<div data-role="header">
<div data-role="content">
<p>Page 1</p>
<p>The output of this page can be seen in your javascript console.</p>
The following link will show how to inject a page using the pagebeforeload evt<br/>
<a href="externalUrl?blablabl">external url</a><br/>
<div data-role="footer">
<h4>Index footer</h4>
Jump to Line
Something went wrong with that request. Please try again.