发布于 2017-01-19 07:08:23 | 173 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Javascript教程,程序狗速度看过来!

JavaScript客户端脚本语言

Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。


下面的这段js获取视频时长代码是网上找的,还没有测试,需要的朋友可以参考下
网上找的,因为最近要用,但还没试过 

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    <title>无标题文档</title>  
    </head>  

    <body>  
    <p>  
      <object id="player" style="display:none" height="400" width="400" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">  
        <param name="invokeURLs" value="-1">  
        <param NAME="AutoStart" VALUE="-1">  
        <param name="currentPosition" value="0">  
        <param name='uiMode' value='mini'>  
        <param NAME="url" VALUE="test.mpg">  
      </object>  
    </p>  
    <input name="submit" type="submit" onclick="getInfo()">  
    <p>  

    <script language="javascript">  
     var time;  
      function getInfo(){  
      var pl=document.getElementById("player");  
       time=pl.currentMedia.durationString;  
       alert(parseInt(pl.currentMedia.durationString.substring(0,2)*60));  
       //alert(parseInt(pl.currentMedia.durationString.substring(3,5)));  
      alert(parseInt(pl.currentMedia.durationString.substring(0,2)*60)+parseInt(pl.currentMedia.durationString.substring(3,5)));  
     }  
    </script>  
    </p>  
    </body>  
    </html>  


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务