ajax.js
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- function startRequest(xmlHttp,reqURL,showContent) {
- xmlHttp.open('GET',reqURL,'true');
- xmlHttp.onreadystatechange = function handleStateChange(){
- if(xmlHttp.readyState == 2) {
- document.getElementById(showContent).innerHTML = "正在载入......";
- }
- if(xmlHttp.readyState == 4) {
- if(xmlHttp.status == 200) {
- var allcon = Bin2Str(xmlHttp.responseBody);
- document.getElementById(showContent).innerHTML = allcon;
- }
- }
- };
- xmlHttp.send(null);
- }
- function show(c_Str){
- if(document.all(c_Str).style.display=='none'){
- document.all(c_Str).style.display='block'
- }else{
- document.all(c_Str).style.display='none'
- }
- }
- function Bin2Str(Binary){
- try{
- var axRs = new ActiveXObject('ADODB.RecordSet');
- axRs.Fields.Append('Binary2String',201,1);
- axRs.open();
- axRs.addNew();
- axRs(0).appendChunk(Binary);
- axRs.update();
- var Result = axRs(0).value;
- axRs.Close();
- return Result;
- }catch(e){
- return null;
- }
- }