javascript code in while loop
i want to use javascript code in a php while loop, but it doesn't work. I
get records from mysql database by a while loop. But javascript code works
for only first record and doesn't work for others. How can i fix this
trouble? This is my code:
$query_d="SELECT id,videocode FROM series ORDER BY id DESC LIMIT 0,12";
$result_d= @mysql_query ($query_d) or die(mysql_error());
while($row_d= mysql_fetch_row($result_d))
{
echo "<video id='vid1' width=\"280\" height=\"200\"
style=\"float:left;margin-right:5px\" controls>";
echo "<source src=".$url_path.$row_dizi[5].".mp4"." type=\"video/mp4\">";
echo "<source src=".$url_path.$row_dizi[5].".ogv"." type=\"video/ogg\">";
echo "Your browser does not support the video tag.";echo "</video>";
echo "<scriptlanguage= 'javascript'type='text/javascript'>".
"document.getElementById('vid1').addEventListener('loadedmetadata',
function() {this.currentTime = 10;}, false);</script>";
}
No comments:
Post a Comment