Здравствуйте есть код
<script type="text/javascript">
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('ytplayer', {
height: '450',
width: '854',
videoId: 'i3aVELDSQLA',
playerVars: {
autoplay:'1',
controls:'1',
enablejsapi:'1'
}
});
}
</script>
<br>
<br>
<div id="but"></div> <script type="text/javascript">
var link = document.getElementById('but'); setTimeout('inCounting()',3000); function inCounting() { var timer = setInterval('stCounting()',500);} function stCounting() { ytplayerTime = player.getCurrentTime(); ytplayerTime += ''; if(ytplayerTime.indexOf('.') > 0) { ytplayerTime = ytplayerTime.substring(0, ytplayerTime.length-2); } if((ytplayerTime == '15') || (ytplayerTime == '15.')) {link.innerHTML = '<div><a href="http://mysite.com/ak/r.php?idg=***9&idp=13036"><img src="pom/dkz.jpg" border="0" /></a></div>' ; }}
</script>
Должен выполнить innerHTML. а не выполняет, подскажите пожалуйста в чем проблема?