Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Refactor: Ajax callback breakout

StevenBlack edited this page May 29, 2011 · 2 revisions

Current situation (as of late May 2011, pre-Beta 1)

  • The jQuery Mobile $.ajax() call lives in jquery.mobile.navigation.js within a function named $.mobile.loadPage.

  • The success and error callbacks are defined inline within the $.ajax() call itself.

  • The notion is breaking-out these callbacks would greatly improve jQuery Mobile extensibility by making the callbacks accessible.

Current blockers in the success callback

In order to split-out the success callback we'd need to address the following issues:

  • Reference to memvar fileUrl which is defined in the $.mobile.loadPage closure. fileurl is moreover dependent on memvar absUrl which depends on $.mobile.loadPage parameter url.

  • Reference to memvar base which is defined in the $.mobile.loadPage closure.

  • Reference to memvar page which is defined in the $.mobile.loadPage closure. Memvar page is derived from memvar settings which is the result of the options passed-in to $.mobile.loadPage via $.extend( {}, $.mobile.loadPage.defaults, options )

  • Reference to memvar deferred defined in the $.mobile.loadPage closure.

  • more (?)

Current blockers in the error callback

In order to split-out the error callback we'd need to address the following issues:

  • Reference to memvar base which is defined in the $.mobile.loadPage closure.

  • Reference to memvar deferred defined in the $.mobile.loadPage closure.

Clone this wiki locally