Two little problems on Twitch project

Hey,

Just two little things:

  1. The links kinda work - they open up a window with the correct path, but the window just stays blank. When I cut and paste that exact url into a new window, it loads just fine.

  2. When I use the radio buttons and it’s only the online users, the page shifts a little. Any ideas?

Thanks,
Kevin

  1. The links don’t seem to be working well for me either way.

  2. Notice how the scroll bar appears when the page height exceeds the viewport height. This causes bootstrap to readjust as the window has become slightly smaller.

Hi, thanks for the reply.

  1. I’m not sure what you’re saying here. Are you saying that my links don’t work or that you couldn’t get them to work in your project. Assuming it’s the former, I tested it again. When I push a link, the page opens a new window and the correct url gets put in the address line. But page finishes loading (the reload icon is there) but the page is blank. If I reload, the same thing happens. If I cut and paste that EXACT url out of the blank page into a new window, it loads just fine. For whatever reason, the problem seems to be the window that codepen is creating.

  2. That makes complete sense, thank you. The scroll bar changes the width of the window so everything readjusts. I suppose I could do some math and put everything at a fixed distance from the left instead of centering it - if it bothers me.

This is the code:

$("#name-area").append('<p class = "data ' + online + '"><a id = "fcc-link" href = "https://www.twitch.tv/' + account + '"target = "_blank">' + account + '</a></p>');

The variable account is a string of the user name and the variable online is a string saying either “online” or “offline”.

When executed with the username “freecodecamp” it renders this element in html:

freecodecamp

That url works beautifully when I cut and paste it, but fails when I use the hyperlink.

Does anyone know why?

Basically, this is a security “feature” on Twitch’s side. They don’t load for links in iframes. There’s nothing you, I, or the Eldritch powers can do about it.