J
jackwootton
Hello,
I am programmingly only for Firefox.
I have a couple (hopefully simple) questions:
1. When would I use cloneNode and when importNode? Keeping in mind
that neither importNode or cloneNode keep event handlers that have
been registered on the nodes. So I must re-register the event
handlers each time.
2. Can anyone provide their opinion on the following design decision I
made: I have a class which is provided a document object when it is
created. The document object is then used with the createNode and
createTextNode methods to create and assemble a XHTML form and sme
divs and spans to go with. I then have an array of objects that use
this class to retrieve the XHTML elements created. importNode is then
used to allow the nodes to be used in a different document.
Basically point number 2 comes down to the fact that I thought it
would be more efficient to create all the nodes a require on a single
document. And then everytime I require them subsequently, I would use
importNode, rather than creating them from scratch each time.
Bad idea or good idea?
Many thanks,,
Jack
I am programmingly only for Firefox.
I have a couple (hopefully simple) questions:
1. When would I use cloneNode and when importNode? Keeping in mind
that neither importNode or cloneNode keep event handlers that have
been registered on the nodes. So I must re-register the event
handlers each time.
2. Can anyone provide their opinion on the following design decision I
made: I have a class which is provided a document object when it is
created. The document object is then used with the createNode and
createTextNode methods to create and assemble a XHTML form and sme
divs and spans to go with. I then have an array of objects that use
this class to retrieve the XHTML elements created. importNode is then
used to allow the nodes to be used in a different document.
Basically point number 2 comes down to the fact that I thought it
would be more efficient to create all the nodes a require on a single
document. And then everytime I require them subsequently, I would use
importNode, rather than creating them from scratch each time.
Bad idea or good idea?
Many thanks,,
Jack