Hi Kru, I am wanting to use the load event (http://docs.jquery.com/Events/ load) to know when the iframe has been loaded, not load content into a div. #testFrame is the ID of my iframe.
What I would like to do is use ajax events triggers to fake some ajax events, e.g. $.event.trigger('success'); . But I am not sure I understand what to do once I add $.event.trigger('success'); . On Nov 2, 2:34 pm, Kru <[EMAIL PROTECTED]> wrote: > Hey there, > > I hope I understand this right. Say you have a link with class mylink. > Once clicked you want to load mypage.php into a frame with id > testFrame. > After everything has loaded you would like to trigger an alert with > the message Hello. > > This would look something like the code below: > > $('a.mylink').click( function () { > $('#testFrame').load("mypage.php", function () { > alert ("Hello"); > }); > > }); > > I hope this helps :) > Maybe you could look at the ajax function as well as it has callbacks > for success and error responses from the server. (http:// > docs.jquery.com/Ajax/jQuery.ajax#options) > > k > > On Nov 3, 10:43 am, Nic Hubbard <[EMAIL PROTECTED]> wrote: > > > I am trying to trigger an ajax event when my iframe is loaded. I kind > > of understand the concept, but I am slightly confused. If I do get > > the even triggered after my iframe has loaded, what do I do to get the > > fake ajax event to use a function? > > > $('#testFrame').load(function () { > > $.event.trigger('success'); > > > }); > > > Basically I want to run a function when a link is clicked to load > > content into an iframe, and then run another function when the iframe > > content has loaded. > > > Thanks!