For example, a embed node like this:
document.createElement('embed');
ctrlEmbed.setAttribute('id', moduleid);
ctrlEmbed.setAttribute('src', 'xx.nmf');
ctrlEmbed.setAttribute('type', 'application/x-pnacl');
node.addEventListener('load', moduleDidLoad, true);
And the moduleDidLoad Function is:
function moduleDidLoad()
{
ctrlMoudle = document.getElementById(moduleid);
}
As the Native Client develop guide say,If you want get the handle of native client module,you must call document.getElementById(moduleid) in the callback function of 'load' event. My question is, can i just call document.getElementById(moduleid) after i create the element?I've tried but failed.Do i have to call document.getElementById(moduleid) after the is loaded?