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 to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with appendChild and childNodes

    I'm having a problem in Firefox when trying to make a dynamically generated div jump to the front onclick. These are the two functions in question. The first is fired when the user clicks a link and the second fires when the user clicks on the div created by openWindow().

    These work fine in IE, but Firefox doesn't seem to see the dynamically created divs. Please help.


    function openWindow(windowAddress, windowName){
    newDiv = document.createElement('div')
    newDiv.id = windowName
    newDiv.style.border= "1px solid black"
    newDiv.style.background = "#FFFFFF"
    newDiv.appendChild(document.createTextNode('Loading...'))
    $('content').appendChild(newDiv)
    newDiv.style.position = "absolute"
    newDiv.style.top = "60px"
    newDiv.style.left = "10px"
    new Ajax.Updater(newDiv, windowAddress, {asynchronous:true, evalScripts:true}); return false;
    }


    function bringToFront(windowId){
    openWindows = $(windowId).parentNode.childNodes
    for(i=0; i<openWindows.length; i++){
    if (openWindows[i] == $(windowId)){
    $(windowId).style.zIndex = '99'
    }
    else{
    openWindows[i].style.zIndex = '1'
    }
    }
    }

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Turns out the problem has to do with the way Firefox handles whitespace... if you are really interested let me know and I will post my findings, otherwise feel free to ignore this post altogether.


  •  

    Posting Permissions

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