Why does the youtube api_iframe not work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why does the youtube api_iframe not work?

I have the code from this side: https://codepen.io/imelgrat/pen/MrZRPe?editors=1000 there it works fine put not in my Visual studion and not here has anyone an idea https://code.sololearn.com/WAx3onbq09f4

2nd Nov 2018, 5:53 PM
jack
jack - avatar
8 Answers
+ 2
I'm including this so you can copy the onerror() function if you like. https://code.sololearn.com/WY2xou48ucG4/?ref=app
2nd Nov 2018, 7:52 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Well it looks like your trying to use jquery without having it loaded. Copy and paste this code in the header. <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
2nd Nov 2018, 6:11 PM
Mike
+ 1
Well I found two things after looking at youtube api. First when it says tag.src you are saying https://youtube.com/iframe_api when it should be https://www.youtube.com/iframe_api. After that its just a matter of jquery trying to run before the page is loaded. I have a working version below. https://code.sololearn.com/W0tqtyW204EI/#html
2nd Nov 2018, 7:01 PM
Mike
0
thanks:) there I was a bit blind
2nd Nov 2018, 6:19 PM
jack
jack - avatar
0
No problem! That's why you gotta ask questions
2nd Nov 2018, 6:22 PM
Mike
0
still not work hmm
2nd Nov 2018, 6:23 PM
jack
jack - avatar
0
thanks a lot for your help! it's so great if you struggling longer with a code and than you get hel:)
2nd Nov 2018, 8:23 PM
jack
jack - avatar