I have two sites A.com and B.com. I need to embed B.com in an iframe on A.com. I cannot make changes to B.com
B.com only works with mail requests with some messages. I work as follows
<div id="frameDiv"></div>
<script type="text/javascript">
var $ifr = $('<iframe name="myFrame" id="myFrame"></iframe>');
var $form = $('<form action="B.com" method="post" target="myFrame"></form>');
$form.append($('<input type="hidden" name="dataName"><input>').val('data'));
$('#frameDiv').append($ifr.append($form));
$form.submit();
</script>
Now B.com loads perfectly in the iframe with a response to the send request. But B.com is slow. I want to show the spinner inside #frameDiv before loading the iframe. How can i do this?
This is what I tried:
$('#frameDiv').append($spinnerImage)
$ifr.load(function(){
});
$ifr.ready(function(){
});
If B.Com was a simple get and was set as the src attribute for an iframe, the jQuery loading method does the trick. But in this case it is not so.
Any help is appreciated :)
source
share