Is it possible to have one jQuery ready block executed after all others have done so.
I have this in my master page ...
<script type="text/javascript">
$(document).ready(function()
{
$("input[type='text']:enabled:first", document.forms[0]).focus().select();
});
</script>
and this in one of my other pages ...
<script type="text/javascript">
$(document).ready(function()
{
$('textarea.message-body').wysiwyg();
});
</script>
The problem I am seeing is that the first block is executed before the second block, which is causing a problem with the tab key. What's happening is that the keyboard focus goes to the address bar in my browser when I press the tab key. I've changed the code slightly to have this in my master page ...
<script type="text/javascript">
$(document).ready(function()
{
var bodies = $('textarea.message-body');
if (bodies.length > 0)
{
bodies.wysiwyg();
}
$("input[type='text']:enabled:first", document.forms[0]).focus().select();
});
</script>
and do away with the other ready block completely. Doing that makes the tab key work properly, and set the focus onto my textarea.
I'd rather not have page specific code in my master page.
So, is there a way to make my textbox focusing code run after the wysiwyg code?