How best to Combine document.Ready & onScriptsLoaded

23 views
Skip to first unread message

oddjones

unread,
Feb 17, 2011, 8:57:50 AM2/17/11
to EnhanceJS
Hi,

if we have an enhance call such as...


<script type="text/javascript">
enhance({
loadScripts: [
'/scripts/jquery-1.4.2.min.js', //JQUERY
'/scripts/jquery-ui-1.8.6.custom.min.js', //
JQUERY UI
'/scripts/plugins.js?v=1', //BOILERPLATE
PLUGIN EXCLUSIONS
'/scripts/script.js?v=3', //DOCUMENT READY
FUNCTIONS
'http://widgets.twimg.com/j/2/widget.js',//
TWITTER WIDGET LIBRARY
'/scripts/twitterWidget.js', //FUNCTION TO
DISPLAY TWITTER WIDGET

],
loadStyles: [
{ href: '/app_ldlthemes/css/smoothness/jquery-
ui-1.8.6.custom.css?v=4', media: 'screen' },
{ href: '/app_ldlthemes/css/enhanced.css?
v=2', media: 'screen' }
]
onScriptsLoaded: function(){
displayTwitterWidget();
}
});
</script>


... Is there any way to test for when BOTH the jQuery document.Ready()
is true AND all external scripts have been loaded?
Reply all
Reply to author
Forward
0 new messages