title: How to reload the src of an iframe contained jquery dialog each time the dialog is opend?
body: <p>I have a dialog like this</p>
  
  <pre><code>&lt;div id="dialog"&gt;
    &lt;iframe id="myIframe" src=""&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;button id="opener1"&gt;Open Dialog&lt;/button&gt;
  &lt;button id="opener2"&gt;Open Dialog&lt;/button&gt;
  </code></pre>
  
  <p>My script is as follows</p>
  
  <pre><code>$(function () {
    $("#dialog").dialog({
      autoOpen: false,
      show: "fade",
      hide: "fade",
      modal: true,
      height: 'auto',
      width: 'auto',
      resizable: true,
      title: 'Vessels'
    });
  
    $("#opener1").click(function () {
      $('#myIframe').src = 'http://www.w3schools.com';
      $("#dialog").dialog("open");
      return false;
    });
  
    $("#opener2").click(function () {
      $('#myIframe').src = 'http://www.google.com';
      $("#dialog").dialog("open");
      return false;
    });
  });
  </code></pre>
  
  <p>I want to set the url of the iframe dynamically before the dialog is displayed.
  I tried the above code, but not working</p>