Thank you for your help. I forgot to copy the } after the alert(videoName). So myFunction ends after alert. var playerURL... is not part of the function. I'm trying to take the script out of the function. I'll post back the result.
Thanks for the help. I still can't get it to work. Chrome Javascript console says Uncaught TypeError: Object #<HTMLDocument> has no method 'writeIn' Can you give hint on the approach you prefer? I'm a newbie on Javascript. Thanks,
Don't use doument.write() During parsing parts of document (e.g. HEAD-part before body) browser finds script inside of BODY (browser parses body part). In this case the body object is real exist. document.write in use of Internet Explorer may create an NEW BODY and new document. To append objects inside actual document - actual body - please use Javascript functions createElement() and appendElement(). var X01=document.createElement("IMG"); if(X01!=null) {var X02=document.body.appendChild(X01); if (X02!=null) { // X02 is pointer of created object inside body } }