/documentation/af.ui/$.ui.ready.md
Markdown | 46 lines | 29 code | 17 blank | 0 comment | 0 complexity | 55c3118521687c71ffa47bbbf265a563 MD5 | raw file
- #$.ui.ready
- ```
- function to fire when afui is ready and completed launch
-
- ```
- ##Example
- ```
- $.ui.ready(function(){console.log('afui is ready');});
-
- ```
- ##Parameters
- ```
- function Function
- ```
- ##Returns
- ```
- undefined
- ```
- ##Detail
- $.ui.ready - this is similar to $(document).ready but fires after App Framework UI has launched.
- If you use data-defer to load content, this launches AFTER all data-defer files are loaded.
- If the event has already dispatched and you create a $.ui.ready function, it will execute right away.
- ```
- $.ui.ready(function(){
- //App is ready lets check if a user exists.
- if(user===false)
- return $.ui.loadContent("#login");
- else
- return $.ui.loadContent("#main");
- });
- ```