From 96b3e710d40afb8565531f631c8dd651f9f2d213 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 16 Jun 2011 15:43:40 -0700 Subject: [PATCH] Added utility functions $.mobile.getDocumentBase() and $.mobile.getDocumentUrl() so that developers can retrieve the original base and url used when loading the document. --- js/jquery.mobile.navigation.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 721ddbdf..0bb6cd49 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -490,6 +490,16 @@ //enable cross-domain page support $.mobile.allowCrossDomainPages = false; + //return the original document url + $.mobile.getDocumentUrl = function(asParsedObject) { + return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href; + }; + + //return the original document base url + $.mobile.getDocumentBase = function(asParsedObject) { + return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href; + }; + // Load a page into the DOM. $.mobile.loadPage = function( url, options ) { // This function uses deferred notifications to let callers