2

I was told to check if I am in an iframe but I do not think so unless that is part of godaddy Website Builder. I am really stuck and need help.

To see the problem, enter this URL "gainesrad.com/readqrcodefromkiosk/"

It should display the URL of the webpage but instead I get the words "about:srcdoc".

Here is the HTML code loaded on gainesrad.com/readqrcodefromkiosk

<!DOCTYPE html>
<html>
    <body>
        <b>This should tell me the URL of the page but instead it says "about:srcdoc"</b>
        <p id="demo"></p>
    </body>
    <script>
        document.getElementById("demo").innerHTML = "The full URL is:  " + window.location.href;
    </script>
</html>
BobGaines
  • 45
  • 5
  • You are in an iframe. If you inspect the page and drill down to where that code is, you can clearly see you are in an iframe. – gforce301 Aug 26 '20 at 01:37
  • `self !== window.top` is how you check if you're in an iframe (true if in iframe) – Jaromanda X Aug 26 '20 at 01:41
  • 1
    `Here is the HTML code loaded` no, that's not what is loaded ... a whole bunch of crap, including a suspicious looking serviceworker is loaded - I wouldn't go to that link ever – Jaromanda X Aug 26 '20 at 01:42

1 Answers1

0

If you view the page source for that site, you will definitely notice that your code lies in an iframe. However, to have a programmatic proof of that fact, try this link here to see how you might accomplish that task.

view page source snapshot

  • Thank you for teaching me how to see I am in an iframe. I guess that happens because I am using godaddy Website Builder. I cannot control any code except what you see included in this question above. Any suggestions how I could send a parameter to my HTML code while in this iframe. I want to enter the URL/?parameter but with Website Builder putting my code into an iframe, what can I do? – BobGaines Aug 26 '20 at 14:31
  • Try [these](https://stackoverflow.com/questions/536538/pass-value-to-iframe-from-a-window) solutions – Tafadzwa Chimberengwa Aug 28 '20 at 07:03