include javascript within document write
-
I use Dreamweaver to generate the rollover Javascript code to something like this:
document.write("[");](http://astringforURL=" + theCourseCode + ")
[IT does the link OK not the rollover anymore with this. I think it may relate to the single quotes it had initially and I had to change the double quotes into single quotes while retaining the single quote. I can't put the script to do rollover outside either. How can I make it work? Thanks,](http://astringforURL=" + theCourseCode + ")
-
I use Dreamweaver to generate the rollover Javascript code to something like this:
document.write("[");](http://astringforURL=" + theCourseCode + ")
[IT does the link OK not the rollover anymore with this. I think it may relate to the single quotes it had initially and I had to change the double quotes into single quotes while retaining the single quote. I can't put the script to do rollover outside either. How can I make it work? Thanks,](http://astringforURL=" + theCourseCode + ")
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 } }