Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="../../code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"> <script src="../../code.jquery.com/jquery-1.8.3.min.js"></script> <script src="../../code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> <script> $(document).on("pageload",function(event,data){ alert("pageload event fired!\nURL: " + data.url); }); $(document).on("pageloadfailed",function(event,data){ alert("Sorry, requested page does not exist."); }); </script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>Header Text</h1> </div> <div data-role="content"> <a href="externalpage.html">External page</a> <br><br> <a href="externalnotexist.html">External page that does not exist</a> </div> <div data-role="footer"> <h1>Footer Text</h1> </div> </div> </body> </html>
Result:
W3Schools.com - Try it yourself