惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
博客园 - 【当耐特】
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
B
Blog
有赞技术团队
有赞技术团队
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
Jina AI
Jina AI
Vercel News
Vercel News
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The Cloudflare Blog
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
腾讯CDC

博客园 - Rain@sz

C#多线程编程(转) 调用webservice类(转) webService动态编译(编译在内存中,不会有权限问题) 什么是AOP? (摘) 阿里巴巴信息抓取器 脏读、不可重复读和虚读。(数据库)摘 c#写Activex控件(.Net 2.0) SPS中模拟登陆 sql server 2005分页存储过程和sql server 2000分页存储过程(摘) net的辅助工具 Memento Pattern(备忘录模式) Interpreter Pattern(解释器模式) State Pattern(状态模式) Mediator Pattern(中介者模式) 动态调用Webservice(摘) 分页--页脚控件 RSS 标准 DP-還未添加 DP-职责链模式(Chain of Responsibility)
ajax基本函数--js
Rain@sz · 2007-12-29 · via 博客园 - Rain@sz

function AjaxData(url, domId){
 var http_request = null;
 if (window.XMLHttpRequest) {
  http_request = new XMLHttpRequest();
  if (http_request.overrideMimeType)
   http_request.overrideMimeType('text/html');
 } else if (window.ActiveXObject) {
  try {
   http_request = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    http_request = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (e) {}
  }
 }
 if (http_request==null)
  return false;
 
 http_request.onreadystatechange = function(){
  if (http_request.readyState == 4) {
   if (http_request.status == 200) {  
   
   document.getElementById(domId).innerHtml=http_request.responseText;   
   //alert(document.getElementById(domId).innerText);
   } else {
    return false;
   }
  }
 }
 http_request.open("POST", url, true);
 http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 http_request.send();
 return true;
}

function AjaxSendData(url,func){
 var http_request = null;
 if (window.XMLHttpRequest) {
  http_request = new XMLHttpRequest();
  if (http_request.overrideMimeType)
   http_request.overrideMimeType('text/html');
 } else if (window.ActiveXObject) {
  try {
   http_request = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    http_request = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (e) {}
  }
 }
 if (http_request==null)
  return false;
 
 http_request.onreadystatechange = function(){
  if (http_request.readyState == 4) {
   if (http_request.status == 200) {
   func(http_request.responseText);   
   } else {
    return false;
   }
  }
 }
 http_request.open("POST", url, true);
 http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 http_request.send();
 return true;
}

假如send方法发送了数据,则可以这样来获取send过来的数据
System.IO.Stream instream = Page.Request.InputStream;
BinaryReader br 
= new BinaryReader(instream,System.Text.Encoding.UTF8);
byte[] byt = br.ReadBytes((int)instream.Length);
string sXml = System.Text.Encoding.UTF8.GetString(byt);