 |
рекомендуем |
 | |
|
 |
каталог |
 | |
|
|
|
|
|
|
|
|
", b);
if(e > 0) {
sjs = x.substring(b,e);
eval(sjs);
}
}
};
msgetContent.prototype.ParsMSxml=function(s) {
//alert('PARS: ' + s);
this.vv = "text > " + s;
};
msgetContent.prototype.XmlToString=function(o) {
//alert("1 > " + o.toString());
var oo = o.documentElement;
//alert("11");
//if (oo.xml)
// alert("22" + oo.xml);
var rr = xmlNodeToString(oo);
//alert(rr);
return rr;
};
function xmlNodeToString(o) {
//alert("12 > " + o.tagName);
var rr = '';
//alert("1 > " + o.nodeType);
if(o.nodeType) {
var tp = o.nodeType;
if(tp == 1)
{ // открыв.элементе тега
//alert("11 > " + o.tagName);
rr = rr + "<" + o.tagName;
var attrs = o.attributes;
if(attrs) {
var cAttrs = attrs.length;
//alert("2> " + cAttrs);
var i = 0;
while(i < cAttrs) {
attr = attrs[i];
if(attr)
rr = rr + " " + attr.name + "=\"" + attr.value + "\"";
i++;
}
}
//дочерние элементы
if(o.hasChildNodes()) {
rr = rr + ">";
var childs = o.childNodes;
var cChilds = childs.length;
var j = 0;
while(j < cChilds) {
child = childs[j];
rr = rr + xmlNodeToString(child);
j++;
}
rr = rr + "" + o.tagName + ">";
}
else {
rr = rr + "/>";
}
}
else if(tp == 3)
{ //фрагмент текста
rr = rr + o.data;
}
}
//alert(">>" + rr);
return rr;
}
//<< begin <<<<<<<<<<<<<<<<<<<< CONTLOADER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/*--- content loader object for cross-browser requests ---*/
msgetContent.prototype.ContentLoader=function(url,method,params,contentType,onerror){
if (window.XMLHttpRequest){
this.req=new XMLHttpRequest();
this.tp = "M";
}
else if (window.ActiveXObject){
this.req=new ActiveXObject("Msxml2.XMLHTTP.3.0");
this.tp = "E";
}
this.loadXMLDoc(url,method,params,contentType);
};
msgetContent.prototype.loadXMLDoc=function(url,method,params,contentType){
if (!method){
method="GET";
}
if (!contentType && method=="POST"){
contentType='application/x-www-form-urlencoded; text/xml; charset=windows-1251';
}
if (this.req){
try{
var loader=this;
this.req.onreadystatechange=function(){
msgetContent.onReadyState.call(loader);
}
this.req.open(method,url,true);
// this.req.open(method,url,false);
if (contentType){
this.req.setRequestHeader('Content-Type', contentType);
}
this.req.send(params);
}catch (err){
this.onerror.call(this);
}
}
};
msgetContent.onReadyState=function(){
if (this.req.readyState==msREADY_STATE_COMPLETE){
// if (this.req.status==200 || this.req.status==0){
if (this.req.status==200){
this.onload.call(this);
}else{
this.onerror.call(this);
}
}
else {
this.MLoading();
}
};
msgetContent.prototype.defaultError=function(){
x = document.getElementById(this.mid);
x.innerHTML = '';
alert("error fetching data!"
+"\n\nreadyState:"+this.req.readyState
+"\nstatus: "+this.req.status
+"\nheaders: "+this.req.getAllResponseHeaders());
this.req.abort();
};
//********* end ***** MSGETCONTENT
-->
|
| « |
1 |
2 |
3 |
4 |
5 | » |  | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | |
|
 | « |
1 |
2 |
3 |
4 |
5 | » |
|
|
|