In case the title doesnt make this obvious, Im doing an ajax call, updating a div with the result and then I need to run some javascript on the div - essentially scanning for textareas and turning them into instances of tinyMCE. My question is what to trigger this from.
Im using mootools 1.11 for the ajax call and div update, and it has functions such as onComplete/onSuccess but these trigger when the call is completed/successful, not when the div is updated with the new content. I've tried writing my own too but seem to run into the same problem - even if i've coded to update the div and then run the javascript it runs before the div has finished updating.
Obviously onLoad is out of the question as its not a new page, and embedding javascript into the page doesnt run either - obviously the page is scanned for javascript as the page loads into the browser window/tab but not when a div is updated, so it just sits there.
Has anyone got any good ideas for a way round this either with the mootools framework or another method?
Thanks,
Matt
Start Free Trial