0

I have this code

var c_iframe = document.createElement('iframe');
c_iframe.setAttribute('frameborder', '0');
c_iframe.setAttribute('width', '500');
c_iframe.setAttribute('height', '600'); // <----- 
c_iframe.setAttribute('scrolling', 'no');

but I want the height to be dynamic depending on its content.

how can I do it?

the things is, the content of iframe is loaded per ajax, so iframe loads only once, the first time. then I will change the content by ajax - those new contents are of different height. so, in this case, I cannot use onload to detect the new height.

doniyor
  • 36,596
  • 57
  • 175
  • 260

0 Answers0