The second argument for the load() function is "data", not "callback": http://docs.jquery.com/Ajax/load#urldatacallback
Do this instead: $("span#mycontent").load("mytext.txt", {}, function(){ // callback code here }); -Dan On Fri, Sep 18, 2009 at 5:51 AM, geegler <jkp_fb_st...@myvws.net> wrote: > > How come this code doesn't work? > > $("span#myinfo").mouseover(function(){ > $("span#mycontent").load("mytext.txt",function(){ > var soffset = $(this).offset(); > var stop = soffset.top; > var ihgt = $("div#footer").css("height"); > var mtop = $("div#mydiv").css("top"); > var mhgt = $("div#mydiv").outerHeight() + 50; > var ntop = stop - mhgt; > $("div#mydiv").css("top",ntop); > $("div#mydiv").fadeIn("slow"); > }); > }); > > This version works but, I don't want to display the div element until > the small text file has completed loading. > > $("span#myinfo").mouseover(function(){ > $("span#mycontent").load("mytext.txt"); > var soffset = $(this).offset(); > var stop = soffset.top; > var ihgt = $("div#footer").css("height"); > var mtop = $("div#mydiv").css("top"); > var mhgt = $("div#mydiv").outerHeight() + 50; > var ntop = stop - mhgt; > $("div#mydiv").css("top",ntop); > $("div#mydiv").fadeIn("slow"); > }); >