+ 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*
8 odpowiedzi
+ 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?
+ 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
+ 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
0
I think you should read the documentation here
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
0
I believe sololearn and some websites block certain content from being displayed on iframes. Correct me if I'm wrong
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!
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>
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.