function liveEdit_activate( span, index ) { if ( functions[ index ] && functions[ index ] != null ) { functions[ index ]( span ); } var width = getWidth( span ) + 20; var height = getHeight( span ) + 5; width = ( width < 100 ) ? 200 : width; height = ( height < 20 ) ? 20 : height; if ( span.innerHTML.length < 255 ) { span.innerHTML = ""; } else { span.innerHTML = ""; } span.firstChild.focus();alert(1); } // THE FUNCTION CALLED IS: // function prep_process( text ) {alert(2); prepped_span.innerHTML = text; } but alert(1) is executed before alert(2)....