小弟对JQ不太熟悉,谁能把下面代码变成JQ的写法,谢谢了!!
<script language="JavaScript"type="text/javascript">
function GetResult()
{
var xmlHTTP;
try{
xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
xmlHTTP=new XMLHttpRequest();
}
xmlHTTP.open("POST","ringht.php",false);
xmlHTTP.send(null);
var strResult = unescape(xmlHTTP.responsetext);
tb.innerHTML = strResult;
}
function MyShow()
{
timer = window.setInterval("GetResult()",1000);
}
</script>
<script language="JavaScript"type="text/javascript">
function GetResult()
{
var xmlHTTP;
try{
xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
xmlHTTP=new XMLHttpRequest();
}
xmlHTTP.open("POST","ringht.php",false);
xmlHTTP.send(null);
var strResult = unescape(xmlHTTP.responsetext);
tb.innerHTML = strResult;
}
function MyShow()
{
timer = window.setInterval("GetResult()",1000);
}
</script>
function GetResult()
{
$.ajax({
type:"post",
url:"ringht.php",
dataType:'html'// 或者用text
success:function(txt){
tb.innerHTML = txt;
}
});
}
function MyShow()
{
timer = window.setInterval("GetResult()",1000);
}
</script> 以上代码没有测试,如果有错误,请查阅下手册.