正在加载图片...
//异常,创建对象实例失败 If(!xmlhttp window alert(“无法创建 XmlhtTprequeS对象”); return false. 为了使对象更加容易使用,以下提供了一些辅助例程来简化ⅩMlhttpRequEst 对象的使用过程。 以下三个函数是Ajax最基本的框架,其重要性这里就不赘述了,请大家参考教 材上的说明。 function createRequest( varxmlhttpnull //Mozilla, Firefox if( window XmlhTtpreqUest xmlhttp=newXmlhTtpreqUestO // else if( window. ActiveXObject try xmlhttp=newActivexobject("msxm12.Xmlhttp") catch( anyEx) xmlhttp=newActivexobject("micrOsofT.XmlhtTp catch( anyEx} } } //异常,创建对象实例失败 If ( ! xmlHttp ) { window.alert ( “无法创建XMLHttpRequest对象” ); return false; } } 为了使对象更加容易使用,以下提供了一些辅助例程来简化XMLHttpRequest 对象的使用过程。 以下三个函数是Ajax最基本的框架,其重要性这里就不赘述了,请大家参考教 材上的说明。 function createRequest ( ) { var xmlHttp = null; //Mozilla, Firefox if ( window.XMLHTTPRequest ) xmlHttp = new XMLHttpRequest(); //IE else if ( window.ActiveXObject ) { try { xmlHttp = new ActiveXObject ( “Msxml2.XMLHTTP” ); } catch ( anyEx ) { try { xmlHttp = new ActiveXObject ( “Microsoft.XMLHTTP” ); } catch ( anyEx )
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有