当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 利用javascript实现一些常用软件的下载导航

Javascript
动态生成select选项全接触
不刷新页面动态更新select选项,实现两个select相互操作
网页输入框日期型有效性判定一网打尽
实用Javascript函数之一(自动将输入文本框中的内容转换成大写字符)
实用Javascript函数之二(自动将输入文本框中的内容转换成小写字符)
实用Javascript函数之三(限制文本输入框中只能输入数字\"0\"到\"9\")
实用Javascript函数之四(用于对sString字符串进行前空格截除)
实用Javascript函数之五(用于对sString字符串进行后空格截除)
实用Javascript函数之六(截除字符串前后空格)
如何使用交替的滚动标题
采用DOM模型时创建一个Select节点后,要删除option项的解决方法
javascript函数速查
利用JavaScript和正则表达式进行丰富的日期判断(给其它项目组的代码,有比较好的编程风格和注释)
关于字符串的几个有用函数
FileSystemObject 的例子(处理驱动器、文件夹、文件)
用JScript实现VB.Net,C#的[委托Delegate]:
得到固定字符位置的函数
IE NC通用的藏鼠标右键一法
Menu
foolpot2001菜单

Javascript 中的 利用javascript实现一些常用软件的下载导航


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 136 ::
收藏到网摘: n/a

利用javascript实现一些常用软件的下载导航,非常不错的应用,思路值得借鉴,没看过的朋友可以看下。

将下面的代码保存为jb51.html

复制代码 代码如下:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>javascript 播放器下载导航测试</title>
</head>
<body>
<div id="divcontent" style="text-align:left">好像没找到你要的东西哦:)</div>
<script language="javascript">
function $(id){return document.getElementById(id);}
var name= location.search.substring(1,location.search.length);
var lowername= name.toLowerCase();
var fArr=["scast","cplayer","ants","aplayer","pps","splayer","tvu","tplayer","ppl","pplayer","usee","uplayer","kplayer","pplayer2","uplayer2008"];
for(var i=0;i<fArr.length;i++){
if (lowername==fArr[i]){
var nName=fArr[i].replace('scast','cplayer');
nName= nName.replace('ants','aplayer');
nName= nName.replace('pps','splayer');
nName= nName.replace('tvu','tplayer');
nName= nName.replace('usee','uplayer');
$('divcontent').innerHTML= "您需要下载的解码器文件是:<a href='http://down1.ruanchen.com/"+nName+".exe'>"+nName+'.exe</a><br>(下载后运行一下,然后再点击“流星网络电视”里的节目就可以收看了!)';
}
}
</script>
</body>
</html>

其实的时实际软件下载地址
http://down1.ruanchen.com/hajian/scast.exe
http://down1.ruanchen.com/hajian/cplayer.exe
http://down1.ruanchen.com/hajian/ants.exe
http://down1.ruanchen.com/hajian/aplayer.exe
http://down1.ruanchen.com/hajian/tvu.exe
http://down1.ruanchen.com/hajian/tplayer.exe
http://down1.ruanchen.com/hajian/ppl.exe
http://down1.ruanchen.com/hajian/pplayer.exe
http://down1.ruanchen.com/hajian/usee.exe
http://down1.ruanchen.com/hajian/uplayer.exe
http://down1.ruanchen.com/hajian/kplayer.exe
http://down1.ruanchen.com/hajian/uplayer2008.exe
具体的页面参数调用方式
jb51.html?kpalyer即可