日期:2014-05-16 浏览次数:20545 次
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div>
<video id="videoplayer" width="480" height="400" controls preload src=""> </video>
</div>
</body>
</html>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
//根据QueryString参数名称获取值
function getQueryStringByName(name){
var result = location.search.match(new RegExp("[\?\&]" + name+ "=([^\&]+)","i"));
if(result == null
------解决方案--------------------
result.length < 1){
return "";
}
return result[1];
}
function change(){
document.getElementById("videoplayer").src=getQueryStringByName("url")
}
</script>
</head>
<body>
<div>
<video id="videoplayer" width="880" height="400" autoplay loop controls src="http://vjs.zencdn.net/v/oceans.webm"></video>
<input type=button value="改变" onclick="change()" />
</div>
</body>
</html>