Hello all, I am working on my quote machine project in Front End Libraries. I am using React and have just placed my tweet link. If I right-click ‘open in new tab,’ everything works as expected. If I left-click, I get an error 401. This happens whether I set target="_blank" or not which seemed to be a common fix for many others having trouble linking from codepen.
For the target attribute use target="_top" and after you change and save refresh the pen (F5) completely. Note, the link will not open up in a new tab.
To expand on @lasjorg’s comment, the target="_top" attribute will open the linked webpage (in this case, twitter) in your current window. So before clicking the link, make sure you’ve saved your work.
Wow, that definitely appeared to fix the issue outright.
I would be lying if I said I fully understood why it worked - so is this something to do with codepen’s context and not my link code itself? Or do I have some deeper digging to do?
Thank you for the encodeURIComponent reference! I had no idea anything like that existed. I just picked apart the href in the Twitter Dev Docs haha. My bad.