iframe "refused to connect" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

iframe "refused to connect"

I am practicing to build a website and want to put a video from youtube in <iframe> tag but when i test it out it says "refused to connect". Is it because the website is not hosted yet? *i am very beginner at website designing*

13th Sep 2019, 9:10 PM
Mohammad Al-Turkawi
Mohammad Al-Turkawi - avatar
8 Answers
+ 1
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_youtubeiframe Here I see for them it is working, can you share how you did it?
14th Sep 2019, 12:31 AM
Dejan Dozet
Dejan Dozet - avatar
+ 1
It worked when i clicked on share button on the youtube video then embed and copied the <iframe> link from there. made bo sense, but as long as it work
14th Sep 2019, 1:20 AM
Mohammad Al-Turkawi
Mohammad Al-Turkawi - avatar
+ 1
Just right-click on the yt video and hit "copy embed", then paste it into sololearn, as for other websites idk how to, it just says refused to connect again
10th Sep 2020, 1:25 AM
Nathaniel
Nathaniel  - avatar
0
I think you should read the documentation here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
13th Sep 2019, 9:18 PM
Qudusayo
Qudusayo - avatar
0
I believe sololearn and some websites block certain content from being displayed on iframes. Correct me if I'm wrong
14th Sep 2019, 4:24 AM
Minerals2016
Minerals2016 - avatar
0
Go to the YouTube video that you want to share and select share. Then look for the embedded code and copy and paste that code where you want it in your website. If you are trying to share your YouTube channel in an iframe, then YouTube may say " YouTube refused to connect" when you hover your mouse pointer over the broke sad broken page part. I believe this is to prevent other sites from mirroring your YouTube channel as other sites have done this in the past. It should of worked like this using the code below if you are trying to share another web page. <iframe src="URL"></iframe> Security measures on YouTube or even Facebook can cause the page to say Refused to connect!
30th May 2020, 3:59 PM
Dave Smith
Dave Smith - avatar
0
I've been trying to get around this for months, and finally found a very easy solution that I haven't seen anyone mention. If you're trying to use an iframe to include a website that won't let you, create your own php file, I named mine iframe.php. In that file, put this: <!DOCTYPE html><html><?php echo file_get_contents($_REQUEST['url']); ?></html> <a href="https://nexinfotech.com/">Nexinfotech</a>
7th Apr 2023, 5:30 AM
Avinash
0
https://blogingpot.com Cross-Origin Resource Sharing (CORS) Issue: If you control the server hosting the content, configure it to include proper CORS headers. If you don't control the server, contact the server administrator to enable CORS.
23rd Oct 2023, 4:55 AM
Avinash