Ajax学习总结(1)
时间:2006-10-27 来源:liugao_0614
大家要把处理和请求响应过程搞清晰了.
下面是我总结的一个重要流程和代码
XMLHttpRequest 对象
清单 1. 创建新的 XMLHttpRequest 对象
清单 2. 用 JavaScript 代码捕获和设置字段值
// Get the value of the "phone" field and stuff it in a variable called phone var phone = document.getElementById("phone").value; // Set some values on a form using an array called response document.getElementById("order").value = response[0]; document.getElementById("address").value = response[1]; 获取 Request 对象 清单 3. 以支持多种浏览器的方式创建 XMLHttpRequest 对象
|
相关阅读 更多 +
排行榜 更多 +