I've created an iframe using javascript:
fr=document.createElement('iframe');
fr.src="www.example.com";
fr.onload=doSomething();
document.body.appendChild(fr);
problem is the onload
part seems to be running before the iframe loads -
I get an error in the console (using chrome) about something undefined in the function (and it would be defined once the iframe loads), and when I check, it turns out the iframe was never even appended.