Random Quote Machine - Blocked Page with Twitter

I am trying to send my quote to Twitter but get a Blocked Page error - if I use the example ( https://codepen.io/freeCodeCamp/full/qRZeGZ ) I don’t get the error - the code to set the href looks the same. Please advise

My codepen project is https://codepen.io/alanbradnum/pen/vYpBjGr

Many thanks, Alan

It worked when I went to test the tweet functionality, but , you could test target="\_blank" , and see if it works on your end

I had target="_blank" - I changed it to target="\_blank" but it still doesn’t work :confused:

I tried two different things and they both work:

  1. used target="_top"
  2. used target="_blank" but ran in debug mode

I’m really confused. Please help

I don’t know whats going on. Your original code worked for me. I remember I ran into the same issue when I first did this project too. Have you tried using a different browser?

It is because the Codepen pens run inside an iframe.

_top is a different context as you can see it opens in the same tab and not a new one. Codepen debug mode is not inside an iframe so _blank works.

Thank you for your reply - now it makes sense :slight_smile:
Sorry for the delay in replying to you