Atlas Xml-script

Mar 27, 2007 at 10:14 PM
Hi,



Hi,

I have a problem with the code which follows, I want to use it with firefox, but it work only with IE

I use the last version of Atlas.

Have you any idea?

<scripttype="text/javascript">

Sys.XmlScriptLoader = {

_currentScriptIndex : 0,

_scriptDoms : [],

_scriptUrls : [],


loadXmlScripts :

function() {

var scripts = document.getElementsByTagName("script");

var nodesToRemove = [];


for(var i = 0; i < scripts.length; i++) {

var scriptSrc = scriptsi.src;


if (scriptsi.type == "text/xml-script" &&
scriptSrc !=

null &&
scriptSrc.length != 0) {


this._scriptUrls.push(scriptSrc);
nodesToRemove.push(scriptsi);

}

}



for(var j = 0; j < nodesToRemove.length; j++) {
nodesToRemovej.removeNode();

}



this._loadNext();
},


_loadNext :

function() {

if (this.currentScriptIndex < this.scriptUrls.length) {

this.loadXmlScript(this._scriptUrlsthis._currentScriptIndex++);
}


else {

if (this._scriptDoms.length > 0) {
Sys.Preview.MarkupParser.processDocumentScripts(Sys.Application._markupContext,

this._scriptDoms);
}



this._scriptDoms = [];

this._currentScriptIndex = 0;

this._scriptUrls = [];
}

},


loadXmlScript :

function(url) {

var request = new Sys.Net.WebRequest();
request.set_url(url);

request.add_completed(Function.createDelegate(

this, this._onloadXmlScript));
request.invoke();

},


_onloadXmlScript :

function(executor, args) {

if (executor.get_responseAvailable() &&
executor.get_statusCode() >= 200 &&

executor.get_statusCode() < 300) {


var scriptDom = executor.get_xml();

var pageNode;


for(var i = 0; i < scriptDom.childNodes.length; i++) {

if (scriptDom.childNodesi.nodeName == 'page') {
pageNode = scriptDom.childNodesi;


break;
}

}



this._scriptDoms.push(pageNode);
}


else {

thrownew Error("Could not load xml-script: " + executor.getwebRequest().geturl());
}



//load the next script

this._loadNext();
}

}


window.onload =

function() {
Sys.XmlScriptLoader.loadXmlScripts();

}



</script>
Mar 29, 2007 at 10:52 PM
This is a discussion about the CodePlex web-site itself, not the individual projects. Please direct your question to the appropriate project discussions.