0

I want to load a webpage using an iframe and then close a dialog box that shows up after the iframe loads the content. After that I want the loaded iframe page to scroll to the bottom. Neither the close dialog box nor the scroll to bottom work.

I'm really starting with jQuery, so feel free to through your darts.

<!DOCTYPE html>
<html>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <meta http-equiv="refresh" content="15">
  <style>
    iframe {
      width: 1600px;
      height: 1280px;
      border: 0;
      overflow: hidden;
    }
  </style>
</head>

<body>
  <center>
    <script>
      var timeleft = 15;
      var downloadTimer = setInterval(function() {
        if (timeleft <= 0) {
          clearInterval(downloadTimer);
          document.getElementById("countdown").innerHTML = "Finished";
        } else {
          document.getElementById("countdown").innerHTML = timeleft + " secondes restantes";
        }
        timeleft -= 1;
      }, 1000);
    </script>

    <div id="countdown"></div>


    <iframe id="iframeid" src="https://clients3.clicsante.ca/60032/take-appt/?jobId=35b1c4a0597de5bc087afb88d6ff73d5&jobToken=06375a4c1491ad5ea1bf90783f6b4e69" width="1600" height="1280" frameborder="0" style="border:0" allowfullscreen Element.requestFullscreen() allow-popups="false">
      <script type="text/javascript">
        $(document).ready(function() {
          $("iframeid").load(function() {
            this.contentWindow.scrollBy(0, 100000)
          });
          window.parent.$('.ui-dialog-content:visible').dialog('close');
        });
      </script>
   </iframe>
  </center>
</body>
</html>
Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Ziz
  • 1
  • Firslty, you can't add content within an external `iframe` in the manner you're attrempting. Secondly, and most importantly, the content of the iframe is coming from a cross-domain source, so you cannot access or amend it in any way, due to security restrictions in place in modern browsers. What you're attempting to do is not possible. – Rory McCrossan Jun 22 '21 at 15:04
  • 1
    Understood. Thank you kindly. – Ziz Jun 22 '21 at 15:55

0 Answers0