Menu

#7 taconite-parser event handling problems

open
nobody
None
5
2006-03-13
2006-03-13
No

taconite-parser 1.502
the event object is not passed to the handler function
(at least in firefox mozilla browser). Following
little change seems to solve the problem:

function handleAttributes(domNode,xmlNode) {
var attr = null;
var attrString = "";
var name = "";
var value = "";
var returnAsText=false;
if(arguments.length==3) {
returnAsText = true;
}

for(var x = 0; x < xmlNode.attributes.length;
x++) {
attr = xmlNode.attributes[x];
name = attr.name.trim();
value = attr.value.trim();
if(!returnAsText){
if(name == "style") {
/* IE workaround */
domNode.style.cssText=value;
/* Standards compliant */
domNode.setAttribute(name,value);
}
else if(name.trim().toLowerCase
().substring(0, 2) == "on") {
// changed code begin
if (isIE) {
eval("domNode." + name.trim
().toLowerCase() + "=function(){" + value + "}");
}
else {
domNode.setAttribute
(name,value);
}
// changed code end
}
else {
/* Standards ......

Discussion


Log in to post a comment.