0
 Try
 {
myTextTrack = myPlayer.addTextTrack( 'subtitles','myLabel','en' );
  }  catch(err)
 {
alert('This browser does not support the comments on the video.');
return;
  }

The above should trigger the alert in IE (not in Chrome). But it gives a script syntax error. The code is generated by asp.net and then inserted, so there are carriage return/linefeeds after every line. But that should not matter.

4

2 回答 2

3

If you're able, change the capital T in Try to t.

于 2013-02-24T17:17:25.687 回答
3

JavaScript is case sensitive. try should be lower case

 try
 {
myTextTrack = myPlayer.addTextTrack( 'subtitles','myLabel','en' );
  }  catch(err)
 {
alert('This browser does not support the comments on the video.');
return;
  }
于 2013-02-24T17:18:48.187 回答