I am using prototype.js.I want to append a I-frame on a click on Div.for this I am using following code.
//JS Code
Event.observe(window, 'load', function()
{ $('test').observe('click', function()
{
$('d1').update ('<iframe src="http://www.abc.com" width="100%" height="300px;" border="0" id="myframe"></iframe>');
Effect.toggle('d1','slide'); return false;
});
});
This is working fine but the problem is that I want to show loading image before rendering the iframe and image will be hide when iframe loaded completely. For this I want to call a callback function.but I don't have any idea about this. Please help me how can I do this.