I want to run mp4 videos on web browser. For that i am using flow player and i want to change href content dynamically on page load. I have used below code.
<html><head>
<title>Wow! This is video</title>
<script src="http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
//var Filename = document.getElementById("<%=hdnFileName.ClientID%>").value;
var Filename = "http://www.yahoo.com";
$("a.mylink").attr("href", Filename);
});
</script></head><body>
<!-- <a href="Video/Test.mp4" style="width: 500px; height: 400px;" id="A"></a>-->
<a href="Video/Test.mp4" style="width: 500px; height: 400px; margin: 10px; display: block" class="Test1" id="Test1"></a>
<script language="JavaScript" type="text/javascript">
flowplayer("Test1", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf");
</script></body></html>
Here i will pass anchor tag value externally and i want to set it to anchor tag. But above code is not wotking. Can you please help?
There are two ways that I know of to achieve what you want
1st: Do not set the href to attribute to anything in your HTML and then use js to set it
HTML Code :
JS Code :
2nd: Create a new a Tag and replace the a tag with that
JS Code :