Jquery创建ajax简单实例代码
2013-09-05 20:22
260 查看
Jquery创建ajax简单实例代码Jquery创建ajax简单实例代码
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url,returnfun) {
createXMLHttpRequest();
xmlHttp.onreadystatechange =returnfun;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function weatherStateChange(){
if(xmlHttp.readyState == 4){
$("ipweather").innerHTML=xmlHttp.responseText;
}
}
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url,returnfun) {
createXMLHttpRequest();
xmlHttp.onreadystatechange =returnfun;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function weatherStateChange(){
if(xmlHttp.readyState == 4){
$("ipweather").innerHTML=xmlHttp.responseText;
}
}
相关文章推荐
- 分享Ajax创建简单实例代码
- JQuery中ajax的简单使用教程(附带实例代码)
- php+jquery+ajax+json的一个最简单实例
- jQuery.ajax的简单应用实例 附实例下载
- JQuery处理json与ajax返回JSON实例代码
- jQuery简单的Ajax调用实例
- jquery 之ajax,get,post异步请求简单代码模版
- ajax简单创建代码
- jQuery提交表单ajax查询实例代码
- php+jquery+ajax+json的一个最简单实例
- jQuery+AJAX+ASP.NET简单实例
- jQuery.ajax的简单应用实例 附实例下载
- jQuery使用ajax跨域获取数据的简单实例
- Jquery和JS用外部变量获取Ajax返回的参数值的方法实例(超简单)
- jquery动态创建div与input的实例代码
- html、css和jquery相结合实现简单的进度条效果实例代码
- JQuery的Ajax请求实现局部刷新的简单实例
- JQuery的Ajax请求实现局部刷新的简单实例
- 使用jQuery轻松实现Ajax的实例代码
- php基于jquery的ajax技术传递json数据简单实例