Hi all,
I have a strange problem, my script doesn't work but in testing i saw that putting an alert in my code makes the script to work.. but i don't want to have an alert!!
I have an embed window media video and i want to get the markers from it in javascript to populate a SELECT list. So I copied the code from MSDN:
As you can see in my code if I insert an alert box, it works (my list is populated), else i have an empty list.. I don't understand why.. is it because it's clearing the buffer or something? Is there an alternative way I can do (I don't want an alert), i've tryed creating a cookie it doesn't work.. I know the code for the embed I took from Microsoft is working. It's really a strange Javascript error.. never seen that before.
Here is the code:
Thanks
I have a strange problem, my script doesn't work but in testing i saw that putting an alert in my code makes the script to work.. but i don't want to have an alert!!
I have an embed window media video and i want to get the markers from it in javascript to populate a SELECT list. So I copied the code from MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay/mmp_sdk/mediamarkercount.asp
As you can see in my code if I insert an alert box, it works (my list is populated), else i have an empty list.. I don't understand why.. is it because it's clearing the buffer or something? Is there an alternative way I can do (I don't want an alert), i've tryed creating a cookie it doesn't work.. I know the code for the embed I took from Microsoft is working. It's really a strange Javascript error.. never seen that before.
Here is the code:
Code:
<SELECT ID = "markers" NAME = "markers" LANGUAGE = "JScript"
/* Seek to the marker number that corresponds to the SELECT element
selectedIndex value when the list selection changes. */
onChange = "Player.controls.currentMarker = markers.selectedIndex + 1;
">
<script language="JScript">
[COLOR=green][b]
alert("why when i pop an alert it works but when none it does'nt work?");[/b]
[/color]
// Get the number of markers in the current media item.
var mcount = Player.currentMedia.markerCount;
// Verify that at least one marker exists in the current media item.
if (mcount > 0){
// Loop through the marker list.
for (var i = 1; i < mcount + 1; i++){
document.write("<OPTION>" + Player.currentMedia.getMarkerName(i) + "</OPTION>");
}
}
</script>
</SELECT>
Thanks