Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    prototype - InsertBefore problems in IE6 - FIXED!!

    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

    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)

    Code:
    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);
    		});
    	});
    	prepareProfiles();
    } {
    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!!
    Last edited by rossbruniges; 05-16-2006 at 03:18 PM.

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Fwiw...
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •