Resize an iframe to its contents

You have an iFrame and you want its height to automatically adapts to the size of the page in src.

$("#myframe").load(function() {
	$(this).height($(this).contents().find("body").height() + 30 );
});

NB: the number 30 is an arbitrary number to add extra space