I hope I can find a solution to this one. Here it goes:
After I have submitted my form to add a message to the database, I create a <div>
with the load method. After that I do some stuff in the callback function.
When the function to create the new <div>
has finished, it returns to the calling function that is supposed to prepend the message to the last inserted <div>
.
That's where the problem starts:
I use the selector to find $(someDiv : last)
, but it puts it in the wrong <div>
. So, I know it has something to do with the async process.
I haven't really worked out what I could do to fix this, because now I am not working from a callback function.
If you wanna see a live example The sourcecode is clutterd with debug code in the form of alerts, but you can see what it is doing.