As part of what I'm doing to add a slightly dynamic veneer to an otherwise 
static site I want to pluck fragments from one or more pages and add them 
to the current page. I'm doing essentially the following, but 
getElementById() on a detached Element always returns null.

// Give us somewhere to put an HTML string
var temp = new Element('div');

// htmlOfSomeOtherPage retrieved via an XHR
temp.set('html', htmlOfSomeOtherPage);

// Without this, getElementById on 'temp' returns null
// $('somewhere_else').adopt(temp);

// Find the interesting bit
var newContent = temp.getElementById('content');

// Add that to the current page
$('container').adopt(newContent);


Is there a way to make this work without resorting to temporarily adding 
'temp' to the main DOM?

Chris

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mootools-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to