Skip to main content

Using External Links in HTML Programs

Learn how to fix "refused to connect" errors and blank screens when opening external links in HTML programs

Written by Mike Javor

The CodeHS editor allows students to run and preview their HTML programs in an iframe. This can help students see live updates they make to their program and navigate between other .html files in the program.

However, the iframe may not allow students to access external websites. Many sites block themselves from being opened in an iframe for security reasons.

In order to preview the HTML program and navigate to the external links, open the program in a new window/tab. To open in a new tab:

  • Click the Pop Out Icon next to the address bar in the output window

Gif Demoing how to open a link in a new window

⚠️ Note: If your school or district has enabled Whitelist Enforcement, external websites that aren't on the approved Website Allowlist will be blocked. This will occur if the program is viewed in the iframe or viewed in a new tab.

If a link still doesn't work after popping out to a new window, the domain may need to be added to the allowlist. To learn more, see Using Whitelist and Allowlist Tools to Manage Student Access to External Websites.


Still have questions? Contact our team at support@codehs.com to learn more!

Did this answer your question?