View Full Version : prototype - InsertBefore problems in IE6 - FIXED!!

05-16-2006, 02:45 PM
Heya guys,

I am working on this page http://www.lsbu.ac.uk/about/dev/boardOfGovernors.shtml which i had though was finished - until I checked things out in IE :mad:

the js can be found here http://www.lsbu.ac.uk/about/dev/js/govs.js and my problem seems to be with this function (more importantly the bit in bold)

function preparePage() {
var govenors = getElementsByClass('studentProfile');
govenors.each(function(currGov) {
var currProfile = getElementsByClass('secondChunk',currGov,'DIV');
var govID = currGov.getAttribute("id");
currProfile.each(function(passGov) {
passGov.className += ' hidden';
var govLink = passGov.getAttribute("id");
var includeText = "<p class='pros'><a href='#" + govLink + ">Read profile</a></p>";
new Insertion.Before(govLink, includeText);
} {

IE - just isn't inserting anything. I am using the prototype framework which I though was pretty good cross browser wide.

Anyone got any ideas, suggestions as to fix this?

Hope someone can help, and big thanks to all who try!

edit - the problem was that I had missed a closing ' off the href - I just noticed it before chucking my monitor out of the window!!

Bill Posters
05-16-2006, 07:03 PM
I use the W3C's insertBefore() DOM method in one of my scripts and it seems to do the job equally well in FF and IE6.