I think there is an event listener right in the code below: By placing additional processes in this block:
jFrame.load(function(objEvent) { the processing is delayed until after the files are loaded. I think I'm on the right track. Rick -----Original Message----- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Wednesday, September 23, 2009 12:07 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Need a callback function to delay processing... Hi, Mark, and thanks for the reply... > put them as > something like an event handler on an element and have the form > response include some code to trigger the event This is what I'm not sure how to accomplish in my code below. Can you provide a code example? Thanks for any suggestions! Rick -----Original Message----- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mike McNally Sent: Wednesday, September 23, 2009 10:45 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Need a callback function to delay processing... Put the stuff you want to have happen after the form loads either in the response page from the form submission, or else put them as something like an event handler on an element and have the form response include some code to trigger the event. If you submit stuff with the jQuery AJAX routines, those APIs give you the ability to run functions when the xhr is complete. On Wed, Sep 23, 2009 at 9:37 AM, Rick Faircloth <r...@whitestonemedia.com> wrote: > How can I make a callback function that delays the functioning of the last 4 > lines below until after > > the form thats submitted by this code is completely processed. Images are > being processed > > on the server side and that takes a few seconds. Right now my response > dialog ( last line) is appearing > > before the image processing is complete and if the Close button that is a > part of that response dialog > > is clicked, then it interrupts the images processing. > > > > So I need for the form to be completely processed before the response dialog > appears. > > > > Thanks for any help and suggestions! > > > > Rick > > > > > > Heres the code: > > > > function processAddRentalPropertyForm() { > > > > var addNewRentalPropertyForm = $(#addNewRentalPropertyForm); > > > > addNewRentalPropertyForm.submit(function(objEvent) { > > > > var jThis = $(this); > > var strName = (uploader + (new Date()).getTime()); > > var jFrame = $(<iframe name=\ + strName + \ > src=\about:blank\ /> ); > > > > jFrame.css(display, none); > > jFrame.load(function(objEvent) { > > > > var objUploadBody = > window.frames[strName].document.getElementsByTagName(body)[0]; > > var jBody = $(objUploadBody); > > > > }); > > > > $(body:first).append(jFrame); > > > > jThis .attr(action, > rentalProperties.cfc?method=mAddRentalProperty&returnFormat=json ) > > .attr(method, post) > > .attr(enctype, multipart/form-data) > > .attr(encoding, multipart/form-data) > > .attr(target, strName) > > > > }); > > > > var dialogPosition = $(window).scrollTop(); > > var dialogPosition = dialogPosition + 100; > > $(.rentalPropertyAddResponseDialog).css(top, dialogPosition); > > $(.rentalPropertyAddResponseDialog).fadeIn(250); > > > > } > > > > ---------------------------------------------------------------------------- --------------------------------------- > > "Those who hammer their guns into plows will plow for those who do not." - > Thomas Jefferson > > -- Turtle, turtle, on the ground, Pink and shiny, turn around.