Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-settings.php on line 512

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-settings.php on line 527

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-settings.php on line 534

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-settings.php on line 570

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-includes/query.php on line 61

Deprecated: Assigning the return value of new by reference is deprecated in /home/chickens/public_html/wp-includes/theme.php on line 1109
chickenskinners.com » Blog Archive » Whitespace in Firefox

Whitespace in Firefox

I have been busy doing stuff with the DOM at work. One thing that continually bugs me is that Firefox seems to find a lot of whitespace and called them textnodes. Obviously when you use firstChild, lastChild, nextSibling or previousSibling and you think that what you are getting from your script should be a div or something other than a textnode this can cause some problems.

Internet Explorer seems to have no problem negotiating the whitespace which annoys me as I really like using Firefox and this is one of the few bad things I have come across concerning this browser.

Whitespace in the DOM explains why this happens and provides a handy little script that helps overcome the problem. It probably explains the problem better than I have as well!

Comments

2 Responses to “Whitespace in Firefox”

  1. nuthell

    great.today,when i was coding with firefox,i met the problem.the code is here.
    /*—————–*/
    function mycall(element){
    element=$(element);
    alert(element.className);
    element.nextSibling.style.display=”none”;
    }
    /*———–*/
    the key word-”nextSibling” works well with IE,but died with Firefox.

  2. matthew

    Yep - that looks like the problem - sometimes you can go into the html and remove the spaces and that sorts it but I think the script I mention above takes out the guess work.

Leave a Reply

Subscribe

Who Am I?

No Sweat Apparel.com