易截截图软件、单文件、免安装、纯绿色、仅160KB

简单ajax代码。

  <script type="text/javascript">
<!--
//将用户输入异步提交到服务器
function ajaxSubmit(){
 //获取用户输入
 var question=document.forms[0].question.value;
 //创建XMLHttpRequest对象
 var xmlhttp;
 try{
  xmlhttp=new XMLHttpRequest(); 
 }catch(e){
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 }
 //创建请求结果处理程序
 xmlhttp.onreadystatechange=function(){
  if (4==xmlhttp.readyState){
   if (200==xmlhttp.status){  
    var data=xmlhttp.responseText;
   document.getElementById("result").innerHTML=data;
   }else{
    alert("error");
   
   }
  }
 }
 //打开连接,true表示异步提交
 xmlhttp.open("post", "/dict/servlet/dictAction", true);
 //当方法为post时需要如下设置http头
 xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
 //发送数据
 xmlhttp.send("question="+question);
}
</script>


相关文档:

第二步:泛型通用动态查询(LinQ+Ajax)

我的春秋痴梦第二步:
写一个 通用的 对象 列表 ,还 包含 搜索和 属性过滤。
具体的效果是:
当新 业务 添加一个 表的时候,只需要在 对象模型里的 添加一个 model
后台几乎不需写代码。
(我是后台:激动人心!)
调用的对象,第几页,属性的 过滤 和搜索全是 前台的Ajax参数控制
(我是前台:#$!@#$%$^#$% ......

ajax 发送xml文件,java接受xml文件并解析

红色字体为主要代码
jsp页面中
<script language="javascript">
function  updateDB(operate){
  var objDom=new ActiveXObject("msxml.DomDocument");
   var objRoot=objDom.createElement("All");
   objDom.appendChild(objRoot);
  
  var k=document.ge ......

ajax 基本使用方法

$.ajax({
        type: "post",
        url: loginUrl,
        data: "username=" +uname + "&password=" +pwd,
        async: ......

Ajax基础

1:Ajax可以通过JavaScript的XMLHttpRequest对象与服务器进行通信,通过XMLHttpRequest,JavaScript可以在不重载页面的情况下与服务器进行通信。
 
2:XMLHttpRequest 浏览器支持
 
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
    {
xmlHtt ......

jquery Ajax详解

参数:
options
返回值:
XMLHttpRequest
使用HTTP请求一个页面。
这是jQuery的低级AJAX实现。要查看高级抽象,见$.set、$.post等,这些方法更易于理解和使用。但是功能上有限制(例如,没有错
误处理函数)。
警告:如果数据类型指定为"script",那么POST自动转化为GET方法。(因为script会作为一个嵌入页 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号