title: calling an iframe inside a js function
body: <p>I'm trying to create an external link, that appears within the same site.</p>
  
  <p>Here, If I click on a link it should display the contents of that link(external site) within our site. i.e., if my site is siteA and in that I place a link (to siteB) that will redirect to 'siteB' closing 'siteA'. I just want to avoid the situation besides I want to make the siteB to be opened within the siteA</p>
  
  <p>My idea is when the link is opened, an iframe will be created and the external site will be opened within that Iframe.</p>
  
  <pre><code> &lt;a href="http://www.google.com" target="your_frame_name" onclick="executeOnClick()"&gt;Google&lt;/a&gt;
  
   &lt;script type="text/javascript"&gt;
  
     function executeOnClick(){
        &lt;iframe name="your_frame_name" src="www.google.com" &gt; &lt;/iframe&gt;
               return true;
          }
  
         &lt;/script&gt; 
  </code></pre>
  
  <p>I wrote this code, but couldn't get what I expect. I tried to use button, but it's not working. </p>
  
  <p>Is there any other way to fix my issue..</p>