这段html代码在ie下有问题。

时间:2014-09-05 12:53:31   收藏:0   阅读:213

在chrome下没问题,ie(Win8,IE10), 只有第一次点击的单词才有发音,点击其他的还是发第一次点击的单词

<html>
<head>
     <title></title>
     <script type="text/javascript">
     function PlayWordEn(obj)
     {
          var text = obj.value;
          document.getElementById(test).innerHTML = <source src="http://dict.youdao.com/dictvoice?audio=+text+&amp;type=1" type="audio/mpeg">;
          document.getElementById(test).play();
     }
     function PlayWordUs(obj)
     {
          var text = obj.value;
          document.getElementById(test).innerHTML = <source src="http://dict.youdao.com/dictvoice?audio=+text+&amp;type=2" type="audio/mpeg">;
          document.getElementById(test).play();
     }

     </script>
</head>
<body><p>
<button type="button" onclick =‘PlayWordEn(this)‘ onmouseover=‘PlayWordEn(this)‘ value="one">one</button>
<button type="button" onclick =‘PlayWordEn(this)‘ onmouseover=‘PlayWordEn(this)‘ value="two">two</button>
</p>     <video style="display:none;" controls="" id="test" name="media">
     </video>

</body>
</html>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!