the inline extension is a little too slow, so i wrote the following code
below so that i could manually insert specific div id's (i keep track on the
server-side) into the DynAPI tree. i more-or-less copied the findLayers in
ext/inline.js, sans the recursion. everything works fine in Mozilla, however
in IE5, after running through this, javascript seems to stop working if
i try to manipulate the anything after the first layer. specifically, if
i load id's 'lyr1', 'lyr2', 'lyr3', etc, after onload i can do:
DynAPI.document.getAll()['lyr1'].setHTML('something'); // lyr1
but the following stops javascript processing (but w/ no error given, not
even a warning image in the lower corner of the browser frame):
DynAPI.document.getAll()['lyr2'].setHTML('something else'); // lyr2
any ideas?
Runtime = {
layerq : new Array(),
addLayer : function(id,parent) {
this.layerq.push(new Array(id,parent));
if (this.isLoaded())
this.loadLayers();
},
loadLayers : function() {
var item,id,parent,lyr,div;
while ((item = this.layerq.pop()) != undefined) {
id = item[0];
parent = (item[1] == undefined)? DynAPI.document : item[0];
if (is.def&&!is.ie) {
div = parent.doc.getElementById(id);
} else if (is.ie) {
div = parent.doc.all[id];
} else if (is.ns4) {
div = parent.doc.layers[id];
}
//alert(div);
lyr = new DynLayer(id);
lyr.parent = parent;
lyr.created = true;
lyr.isChild = true;
lyr.elm = div;
if (is.def) {
lyr.css = lyr.elm.style;
lyr.doc = parent.doc;
} else if (is.n4) {
lyr.css = lyr.elm;
lyr.doc = lyr.elem.document;
}
lyr.frame = parent.frame;
lyr.elm.lyrobj = lyr.doc.lyrobj = lyr;
if(is.ns4) {
for (var j in lyr.doc.images) lyr.doc.images[j].lyrobj
= lyr;
for (j = 0;j<lyr.doc.links.length;j++)
lyr.doc.links[j].lyrobj = lyr;
}
parent.children[parent.children.length] = lyr;
if (is.def) {
lyr.x = lyr.elm.offsetLeft;
lyr.y = lyr.elm.offsetTop;
lyr.w = is.ie4?
lyr.css.pixelWidth||lyr.getContentWidth() : lyr.elm.offsetWidth;
lyr.h = is.ie4?
lyr.css.pixelHeight||lyr.getContentHeight() : lyr.elm.offsetHeight;
lyr.bgImage = lyr.css.backgroundImage;
lyr.bgColor = lyr.css.backgroundColor;
lyr.html = lyr.innerHTML = lyr.elm.innerHTML;
} else if (is.ns4) {
lyr.x = parseInt(lyr.css.left);
lyr.y = parseInt(lyr.css.top);
lyr.w = lyr.css.clip.width;
lyr.h = lyr.css.clip.height;
lyr.clip =
[lyr.css.clip.top,lyr.css.clip.right,lyr.css.clip.bottom,lyr.css.clip.left];
lyr.bgColor = lyr.doc.bgColor !=
"lyr.doc.bgColor"?lyr.doc.bgColor:null;
lyr.bgImage = lyr.elm.background.src !=
""?lyr.elm.background.src:null;
lyr.html = lyr.innerHTML = lyr.elm.innerHTML =
"";
}
lyr.z = lyr.css.zIndex;
var b = lyr.css.visibility;
lyr.visible =
(b=="inherit"||b=="show"||b=="visible"||b=="");
}
},
isLoaded : function() {
return DynAPI.loaded;
},
addLoadFunction : function(f) {
DynAPI.addLoadFunction(f);
}
};
/* end Runtime Object Initializer */
Runtime.addLoadFunction("Runtime.loadLayers()");
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help