Error: WRONG_DOCUMENT_ERR: DOM Exception 4 in Safari

Error: WRONG_DOCUMENT_ERR: DOM Exception 4 in Safari

 Hi all,

I'm trying to do the following: open a new window when a button is clicked and move some dom element in the current page (including a <canvas>) to the new page.

   
  1. var w;
  2. function newWindow() {
  3. $(w.document.getElementById('new')).append($('#plot')); //this removes the plot from current page - which is fine
  4. w.print();
  5. }
  6. w = window.open('print.html', 'title');
  7. setTimeout("newWindow()", 200); //gives some time for new window to load
This works in Opera 10 and Firefix 3.5, but Safari gives an error (see subject). I would try cloning, but since it's a canvas the graph information isn't replicated. Does anyone know how to make safari behave the same as firefox on this?

Thanks!