`; var host = document.getElementById('nk-widget-host'); var iframe = document.createElement('iframe'); iframe.setAttribute('title', 'Understanding Price & Growth'); iframe.setAttribute('scrolling', 'no'); iframe.style.cssText = 'width:100%;border:0;display:block;overflow:hidden;min-height:200px;'; iframe.srcdoc = NK_WIDGET_HTML; host.appendChild(iframe); window.addEventListener('message', function(e){ if(e.data && e.data.type === 'nk-widget-height' && e.source === iframe.contentWindow){ iframe.style.height = e.data.height + 'px'; } }); })();