5ilver5aracen
Programmer
Hi
I've created an editable html page by setting the document.designMode. I'm trying to attach an onBeforePaste event handler to the body of the document now but each time I do this the body cannot be referenced. It shows up as Null. It seems that setting designMode on the document stops you referencing the body. Does anyone know how I can get around this? My simplified code is:
alert(document.body); //=[Object]
document.designMode="On";
alert(document.body); //=null
document.body.onbeforepaste=beforePaste(); //this fails
Many thanks in advance
I've created an editable html page by setting the document.designMode. I'm trying to attach an onBeforePaste event handler to the body of the document now but each time I do this the body cannot be referenced. It shows up as Null. It seems that setting designMode on the document stops you referencing the body. Does anyone know how I can get around this? My simplified code is:
alert(document.body); //=[Object]
document.designMode="On";
alert(document.body); //=null
document.body.onbeforepaste=beforePaste(); //this fails
Many thanks in advance