Permalink
Browse files

Added utility functions $.mobile.getDocumentBase() and $.mobile.getDo…

…cumentUrl() so that developers can retrieve the original base and url used when loading the document.
  • Loading branch information...
1 parent 0ec7c3c commit 96b3e710d40afb8565531f631c8dd651f9f2d213 @jblas jblas committed Jun 16, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 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

0 comments on commit 96b3e71

Please sign in to comment.