易截截图软件、单文件、免安装、纯绿色、仅160KB

Javascript Windows MediaPlayer完整示范版

一、主页面(采用jsp实现)
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@page import="org.accp.jwebplayer.biz.MusicBiz"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Insert title here</title>
<mce:script type="text/javascript"><!--

//保存当前播放曲目在列表中的索引
var index = 0;
//var timer = null;
function $(oid){
return document.getElementById(oid);
}

//到指定位置播放
function playposition() {
$('wmp').controls.currentPosition = parseFloat($("position").value);
$("position").value = "1.0";
}

function showMusicInfo(){
$('spnCurrentMediaName').innerText = $('wmp').currentMedia.name;
$('spnCurrentMediaDuration').innerText = $('wmp').currentMedia.durationString;
$('spnCurrentMediaWidth').innerText = $('wmp').currentMedia.imageSourceWidth;
$('spnCurrentMediaHeight').innerText = $('wmp').currentMedia.imageSourceHeight;
$('spnCurrentMediaMarkerCount').innerText=$('wmp').currentMedia.markerCount;
$('spnCurrentSourceURL').innerText = $('wmp').currentMedia.sourceURL;
}

//下一首
function next(){
if (index<$('playList').options.length-1){
index++;
$('wmp').URL=$('playList').options[index].value;
$('playList').selectedIndex=index;
showMusicInfo();
}
}



//上一首
function pre(){
if (index>0){
index--;
$('wmp').URL=$('playList').options[index].value;
$('playList').selectedIndex=index;
showMusicInfo();
}
}

//检查播放器的状态
//function checkState(){

// if ($('wmp').playState==1){
// n


相关文档:

javascript 实现继承

<mce:script language="javascript" ><!--
function person(name,age)
{
this.name=name;

this.age=age;
}
function man(name,age)
{
this.sex="男";
this.base=person;
this.base(name,age);
}
function woman(name,age)
{
this.sex="女";
this.base=person;
this.base(name,age)
} ......

javascript中setTimeout()函数

javascript中setTimeout()函数
大家都知道javascript中的setTimeput()函数的作用,一般会用他来处理一些连续的事情,们先看一个例子:
<head>
    <script>
        function init()
         ......

JavaScript中的Static overflow at line

今天在学习Bom时遇到了一个错误:
Static overflow at 7
错误原因:自定义了一个 scrollTo(),与系统window.scrollTo()冲突,以致引起死循环,此错误在弹出错误框,而在FF下没有反应,但function也不执行。另外<img src="" onerror=""/>也可能出现这种情况。详细请参考:http://www.cnblogs.com/S.Sams/archive/200 ......

javascript split的用法

有时候进行ajax交互的时候,返回的数据可以自己添加分隔符,比如^^^,然后对这些分隔符进行解析,分解为一个数组。
function fill(v) {
if (v == undefined)return false;
var result = v.split("^^^");
$("#cnPatent").val(result[0]);
$("#cnPText").val(result[1]); ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号