Pens that have empty link elements or code that attempts to change the page’s document.location will show a “Referred from Pen” message in the Pen’s preview panel when the empty link is clicked, or when the code tries to update the location value.

If you see this message, you can go back to the previous view of the Pen preview by clicking the “Go Back” button. If you own the Pen, you can update it to prevent this message from appearing. Here’s how!

Link with no href value

Link elements without a value for the href attribute don’t have anywhere to go! There are two ways to resolve this in a Pen you own:

  • add a valid URL to the href attribute of your link
  • give the href attribute a placeholder value, like #

Visiting a Pen that attempts to change document.location

Pens that include code that attempts to change the document.location value of the page will not load in Pen previews. If you want to test out code that works with document.location you can visit the Debug View of the Pen. If the document.location change is not relevant to your Pen, you can resolve this error by removing the code that attempts to change it.

Was this article helpful?
YesNo