All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
PHP学习宝典-第三章_[PHP教程]
如何抓取到Asp.Net中-doPostBack获取新页面的数据_.net资料_编程技术
visual c++中的画笔类CPen使用实例
PHP实例:PHP如何实现在线发邮件_[PHP教程]
sql语句_mssql学习_编程技术
Asp.net,MVC2.0初级教程-显示列表和内容页_[Asp.Net教程]
谈谈个人地方分类网站的推广和赢利_JavaScript技术_编程技术
理解PHP5中static和const关键字_[PHP教程]
SQL Server 2000 标准版安装_[SQL Server教程]
Asp.net,Ajax-我可以用javascript做些什么?_[Asp.Net教程]
Reading number is top 10 pictures
Sora aoi mirror memorial classics4
Nine school beauty star those gossip matters
The Soviet union swimsuit exposure in the 70 year2
Desktop Wallpapers1
Fan bingbing black wings for platform and DanLuoWang believes beauty2
这两天,中国人民到处都可以“看海”了
Tie a large font of mouse
BingBingFan apple dew point photo gallery1
西方气质的东方美女3
王艳写真温柔如水1
Download software ranking
DreamWeaver8
Such love down(擒爱记)
WebService在.NET中的实战应用教学视频 → 第2集
Professional killers2 for Android
双旗镇刀客B
豪门浪荡史
Tram sex maniac 2 (H) rar bag10
Unix video tutorial12
传奇私服架设教程
Prostitutes diary
aaa published in(发表于) 2013/12/13 9:40:27 Edit(编辑)
ASP.NET技巧:创建不了XMLHTTP控件_.net资料_编程技术

ASP.NET技巧:创建不了XMLHTTP控件_.net资料_编程技术

ASP.NET技巧:创建不了XMLHTTP控件_.net资料_编程技术-你的首页-uuhomepage.com







最近在用ajax开发服务器程序,发现IE浏览器不支持xmlhttprequest对象,而且找不到Microsoft.XMLHTTP控件。




问题出现了我们需要解决,解决方案如下:




1、运行下regsvr32 msxml3.dll;
2、用现成的框架来做ajax;
3、代码优化:




if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}




if(handle_s == null)
handle_s = "bin/normal.py/db";
this.xmlHttp.onreadystatechange = handle_l;
this.xmlHttp.open("GET",handle_s,true);
this.xmlHttp.send(null);




或判断浏览器




var agt = navigator.userAgent.toLowerCase();
var is_ie = (agt.indexOf("msie") != -1);
var is_ie5 = (agt.indexOf("msie 5") != -1);
var is_opera = (agt.indexOf("opera") != -1);
var is_mac = (agt.indexOf("mac") != -1);
var is_gecko = (agt.indexOf("gecko") != -1);
var is_safari = (agt.indexOf("safari") != -1);




function CreateXmlHttpReq(handler) {




var xmlhttp = null;
if (is_ie) {
// Guaranteed to be ie5 or ie6
var control = (is_ie5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";




try {
xmlhttp = new ActiveXObject(control);
xmlhttp.onreadystatechange = handler;
} catch (ex) {
// TODO: better help message
alert("You need to enable active scripting and activeX controls");
}




} else {




// Mozilla
xmlhttp = new XMLHttpRequest();
xmlhttp.onload = handler;
xmlhttp.onerror = handler;




}




return xmlhttp;
}




或者






























添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.