I have this problem:
User clicks to a link to the other page. When this event occurs i want to load an iframe. I need to load that iframe before new page will start loading.
How can I do that?
edit:
I have code as fallow:
function letsDoThis(parameter)
{
var iframe=document.createElement('iframe');
iframe.src="http://xxxxxxxxx"+parameter;
iframe.width='1';
iframe.height='1';
document.body.appendChild(iframe);
}
var a=$('#MY_BUTTON')[0].href;
$('#MY_BUTTON')[0].addEventListener('click',function(){letsDoThis(a);});
but in this solution iframe doesn't load at everytime (sometimes new page will start loading too fast).