views:

49

answers:

2

I can't retrieve the contents of an iframe, when designmode = 'on'. Here is my code:

val = $("#frame").val();

I've tried everything, and nothing works, help?

A: 

Call .contents().find('body').html().

SLaks
this doesn't work. any other suggestions?
David
Try `.contents().children().html()`.
SLaks
A: 
var iframe = $("#frame")[0];
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
var val = iframeDoc.body.innerHTML;
Tim Down
@David: did this work?
Tim Down