How to pass search parameter to iframe?

You can use below code to pass parameter from search widget to a page with an iframe

 <iframe src="" width="100%" height="1200px" scrolling="yes" frameborder=yes></iframe>
<script type="text/javascript">
 var form = '';
 var params =;
 var thisScript = document.scripts[document.scripts.length - 1];
 var iframe = document.createElement('iframe');

 iframe.setAttribute('src', form + params);
 iframe.setAttribute('width', '100%');
 iframe.setAttribute('height', 1000);
 iframe.setAttribute('type', 'text/html');
 iframe.setAttribute('frameborder', '5px solid #000000');
 iframe.setAttribute('allowTransparency', 'true'); = '0';

 thisScript.parentElement.replaceChild(iframe, thisScript);




Users who have LIKED this post:

  • Alex