Hello,
I am trying to create a dynamically loaded popup window with embedded youtube content. The code works fine except I get only a black youtube window with a red play button. When the play button is clicked the player displays "An error occurred. Please try again later."
This is happening Edge, Firefox, and Safari.
Can anyone tell me why this is not working?
here is the code...
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style>
#youTube_pop {z-index: 1;
position: absolute;
top: 60px;
left: 10px;
background: rgba(255,255,255,1);
display: none;
text-align: center;
border-top-left-radius: 6px 6px;
border-bottom-left-radius: 6px 6px;
border-top-right-radius: 6px 6px;
border-bottom-right-radius: 6px 6px;
border-color:black;
border-width: 3px;
border-style:solid;
}
</style>
<script type="text/javascript">
function onYouTubeClick(theLink,caption) {
document.getElementById("youTube_pop").style.display="block";
document.getElementById("youTube_pop").innerHTML = ""+caption+"<br><iframe width=\"854\" height=\"480\" src=\""+theLink+"\ frameborder=\"0\" ></iframe><br><input id=\"clickMe\" type=\"button\" value=\"Close\" onclick=\"closeYouTube();\" />";
}
function closeYouTube() {
document.getElementById("youTube_pop").style.display="none";
}
</script>
</head>
<body>
<a onclick="onYouTubeClick('https://www.youtube.com/embed/adX6ULWKHng','Caption')" href="java script:void(0);">YouTube popup window test</a><br>
<div id="youTube_pop"></div>
</body>
</html>
The quote characters here look incorrect:
Ah yes, exactly. Sometimes it just takes another set of eyes. I was missing a quote.
This works...
src=\""+theLink+"\"
full line
document.getElementById("youTube_pop").innerHTML = ""+caption+"<br><iframe width=\"854\" height=\"480\" src=\""+theLink+"\" frameborder=\"0\" ></iframe><br><input id=\"clickMe\" type=\"button\" value=\"Close\" onclick=\"closeYouTube();\" />";
And a silly question... How do you do the code block. I know it is bad form to just paste code in the body of the message.
BTW, thanks a zillion for your help!!
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)