加载中,请稍后...
加载中,请稍后...
公 告
加载中,请稍后...
我的分类
加载中,请稍后...
最新日志
加载中,请稍后...
最新评论
加载中,请稍后...
最新留言
加载中,请稍后...
登 录
加载中,请稍后...
Blog信息
加载中,请稍后...
链 接




   [原]使用JS POST实现网页无刷新响铃
 

<bgsound src="#" id="sound" loop=1 autostart="true" />

<scrip t LANGUAGE=Javascrip t>

_sd_Post(Url, Args)

{

var xmlhttp;

var error;

eval('try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {xmlhttp = null;error=e;}');

if(null != xmlhttp)

{

xmlhttp.Open("POST", Url, false);

xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

xmlhttp.Send(Args);

strText = xmlhttp.responseText;

}

else

{

strText = 'c_error';

}

return strText;

}

 

var soundPath="/ringin.wav";//文件地址

play(soundPath){

if (all && getElementById){

getElementById("sound").src="/soundPath";}

}

 

Url = '';

Args = '';

_post(){

if (_sd_Post(Url, Args)=='true'){opener.location.reload();}

setTimeout('_post()',120000);

}

if (_sd_Post(Url, Args)=='true'){play(soundPath);}

setTimeout('_post()',120000);

</scrip t>

天长地久 发表于 2007-10-7 22:39:00    阅读全文 | 回复(0) | 引用通告 | 编辑
发表评论:
加载中,请稍后...