| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 414 人关注过本帖
标题:代码没办法执行,页面时空的,,555.asp不会空。
只看楼主 加入收藏
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
结帖率:76.71%
收藏
已结贴  问题点数:20 回复次数:1 
代码没办法执行,页面时空的,,555.asp不会空。
<script type="text/javascript" language="javascript">
   var http_request = false;
   function makeRequest(url,obj)
{
   http_request = false;
           if (window.ActiveXObject) {
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                             try {
                       http_request = new ActiveXObject("Microsoft.XMLHTTP");
                                 } catch (e) {}
                             }
                                     }

                    if (!http_request) {
                        alert('Giving up :( Cannot create an XMLHTTP instance');
                        return false;
                                       }
    http_request.onreadystatechange = alertContents;
    http_request.open('GET', url, true);
    http_request.send(null);


                    function alertContents() {
                          document.getElementById(obj).innerHTML="<font size=2>正在加载数据,请稍候...</font>";
                        if (http_request.readyState == 4) {
                                 if (http_request.status == 200) {
                          document.getElementById(obj).innerHTML=http_request.responseText;
                                                                  } else {
                                 alert('There was a problem with the request.');
                                                                         }
                                                           }
                                              }
}

</script>
<body onload="makeRequest("555.asp","bb")" id="body">
<div id="bb" align="center" width=930  height="100%"></div>
</body>
搜索更多相关主题的帖子: 时空 办法 页面 代码 
2010-05-27 08:35
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:20 
程序代码:
<script type="text/javascript" language="javascript">
   var http_request = false;
   function makeRequest(url,obj)
{
   http_request = false;
           if (window.ActiveXObject) {
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                             try {
                       http_request = new ActiveXObject("Microsoft.XMLHTTP");
                                 } catch (e) {}
                             }
                                     }
                    if (!http_request) {
                        alert('Giving up :( Cannot create an XMLHTTP instance');
                        return false;
                                       }
    http_request.onreadystatechange = alertContents;
    http_request.open('GET', url, true);
    http_request.send(null);

                    function alertContents() {
                         document.getElementById(obj).innerHTML="<font size=2>正在加载数据,请稍候...</font>";
                        if (http_request.readyState == 4) {
                       
                                 if (http_request.status == 200) {
                          document.getElementById(obj).innerHTML=http_request.responseText;
                                                                  } else {
                                 alert('There was a problem with the request.');
                                                                         }
                                                           }
                                              }
}
</script>
<body onload="makeRequest('555.asp','bb')" id="body">
<div id="bb" align="center" width="930"  height="100%"></div>
</body>
双引号改为单引号即可!
你不就是想把无刷新查询申请精华的那个人吗?

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-05-27 14:20
快速回复:代码没办法执行,页面时空的,,555.asp不会空。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021672 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved