jQuery load selector processing

jQuery load selector processing

Currently jQuery.fn.load(str,fn) uses a dummy div to load in contents and then returns the filtering by selector off the contents of that div.  This is all fine and well, until you want to filter by head or body tags.  I found this approach was able to accommodate such a filter and felt... I dunno more semantic:

var iframe = $("<iframe src='javascript:true;' style='display:none;'></iframe>").appendTo("body");
iframe.contents()[0].write(data); // from the xhr response
jQuery(this).html( iframe.contents().find(selector).html() );
iframe.remove();

Any thoughts?