Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Listen for any attempts to call changePage().
- $(document).bind( "pagebeforechange", function(e, data) {
- // We only want to handle changePage() calls where the caller is asking us to load a page by URL.
- if (typeof data.toPage === "string") {
- // We only want to handle a subset of URLs.
- var u = $.mobile.path.parseUrl(data.toPage);
- var home = /^#home/;
- var qrcode = /^#qrcode/;
- if (u.hash.search(home) !== -1) {
- // Display a list of URLs.
- showUrlList(u, data.options);
- e.preventDefault();
- }
- else if (u.hash.search(qrcode) !== -1) {
- // Display QR code for the selected URL.
- showQRCode(u, data.options);
- e.preventDefault();
- }
- }
- });
Add Comment
Please, Sign In to add comment