dynamic HTML cross-browser
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

dynamic HTML cross-browser

From: Aaron Gervais <aarongervais@rogers.com>
Date: Mon Jul 18 2005 - 02:04:20 CEST

I am brand-new to javascript, but after reading some tutorials online I
was able to make a dynamic HTML photo gallery in javascript. It works
fine in all browsers except IE6 (big surprise). I've been looking
around online for solutions, but the fixes I have seen don't seem to
work. I assume I am misunderstanding something... I was using
element.setAttribute but have changed my code to avoid that. Here is an
example. IE6 displays the link text but doesn't do anything else--exact
same result I had by using element.setAttribute('name', 'value').

Any suggestions would be appreciated.
Thx,
Aaron

// scope workaround
function addClick(parent, index)
{
        parent.onclick = function() { getThumbs(index); };
}

// make a link for each gallery
function makeButtons()
{
        obj = document.getElementById("pgallery");
        galholder = document.createElement("div");
        galholder.className = "galleries";
        for ( i = 0; i < gallerylist.length; i++ )
                {
                nd = document.createElement("a");
                nd.className = "media";
                nd.style.cursor = "pointer";
                addClick(nd, i);
                text = document.createTextNode(gallerylist[i][1]);
                nd.appendChild(text);
                galholder.appendChild(nd);
                }
        obj.appendChild(galholder);
        spacer = document.createElement("div");
        spacer.className = "picspacer";
        obj.appendChild(spacer);
}
Received on Tue Oct 18 02:57:28 2005