I'm trying to update the content of a TinyMCE textarea when the user closes a child Fancybox window. This is the function that executes on close which works because my alert is displaying:
$(".popup").fancybox({
'afterClose': function (){
var content = $('#profile').html('<span>NEW CONTENT</span>');
// document.getElementById('profile').value = $_returnvalue;
alert($_returnvalue);
},
});
});
When I put the following line in function document ready it works so I am guessing it is something to do with TinyMCE updating after page load? Grateful for any help.
var content = $('#profile').html('<span>NEW CONTENT</span>');