注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发AJAX → 文章内容

为 OnReadyStateChng 指定参数

作者:佚名 来源:不详 发布时间:2008-5-23 9:17:54

前面涉及的 OnReadyStateChng 在应用 XMLHTTP 时都是使用的全局变量,全局变量是不推荐使用的,我们还是推荐使用局部变量,但 xmlhttp.onreadystatechange = OnReadyStateChng(xmlhttp) 这种方法是不对的,用下面的方法:

function OnReadyStateChng(xmlhttp)
{
    //省略代码
}

//xmlhttp 为 XMLHTTP 对象
xmlhttp.onreadystatechange = function () {OnReadyStateChng(xmlhttp);};
  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体
关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved